DateApril 28, 2008

Get the accents sorted in GTK and QT at the same time

I was facing a problem that it was really annoying. I’m using english and italian at the same time, and I have a english keyboard from which, getting out some accent is a real pain.

e.g.

è à ó í


But I I’m not the only one out there to face this problem and so there are several solutions.
I will speak only about one that is working for me.

Enable the xim module:

add to /etc/enviroments

GTK_IM_MODULE=xim
QT_IM_MODULE=xim

Copy the /usr/share/X11/locale/en_US.UTF-8/Compose to your home

cp /usr/share/X11/locale/en_US.UTF-8/Compose ~/.XCompose

Now you have to choose the Multi_key. It can be anything. Usually I use the  left Windows key. To get the keycode, run

xev

and hit the key. You should get an output like:

KeyRelease event, serial 30, synthetic NO, window 0x2200001,
root 0x13b, subw 0x0, time 105265658, (583,365), root:(587,414),
state 0x10, keycode 115 (keysym 0xff20, Super_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

Now create the file ~/.Xmodmap and write there

keycode 115 = Multi_key

Restart your XServer (log out from the Gnome session or Kde session) and (at least in GNOME) you’ve got a question if you want to load it or not. Load it.

Now you can try. Open anything that can accept a characther and try to click (holding them) “Multi_key ` e”. The result should be “è”.

Note that this is consinstent for both Qt and GTK so if you use mixed applications (as I do), you can write properly in both.

The only issue is the order that it seems to be mandatory. The combination “Multi_key ` e” is working but not “Multi_key e `” that is really annoying. From a first look the first one is defined in the .XCompose and the latter not. This let me think that maybe I can rewrite and add all this combination to this file, however it seems really strange and there should be somewhere an option to make it working.

If anyone of you know how to fix an hint will be appreciated. Otherwise I will have to write a short perl script to fix it.

HIH.

Another blog about bioinformatics

So, some of my friends has set up another blog on Bioinformatics.
The address is phdblog
and the subtitle it’s just true.

70% of what we do doesn’t work

I would just increase the percentual, but hey, we should trust us and hope for the best.

It’s just a new born blog, few articles right now, but it’s growing well.
Keep on eye on it, you wouldn’t regret.

© 2017 Train of Thoughts

Theme by Anders NorénUp ↑

By continuing to use the site (scrolling or clicking counts), you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close