How to enable the Compose key in X
Here I will show you how to enable the Compose key in X. It lets you type unusual characters like this:
Çøµþö§ə kæÿ
by pressing the Compose key followed by a predefined sequence of keys. Here are some good references:
http://en.wikipedia.org/wiki/Compose_key
http://www.hermit.org/Linux/ComposeKeys.html
Anyway, first you need to choose which key you want to be the Compose key. Then, open a terminal and enter the command "xev" (without the quotes). A window called "Event Tester" will pop up. Make sure that it's focused by clicking on it and leaving the mouse cursor in it.
Now press and release the key that you want to become the Compose key. Remember or write down the number after the word "keycode" in the output (see below image):
Now open the file ".Xmodmap" (the name begins with a dot) in your home directory (create it if it isn't there already) with a text editor and type in the following line, replacing <keycode number> with the number you got in xev.
Now, open the file .xinitrc (it's in your home directory, and it's a hidden file) in a text editor. Insert this line in the beginning of the file:
And next time you log in the Compose key should work! To start using the Compose key right now, enter the command "xmodmap ~/.Xmodmap" in a terminal.
Here's some more information abotu the Compose key, including what characters you can type and how:
http://en.wikipedia.org/wiki/Compose_key
http://www.hermit.org/Linux/ComposeKeys.html
IMPORTANT: I can't guarantee that this will work for systems that use a GUI login manager, I don't know how those work. I can only guarantee that this will work with the "startx" command.
Çøµþö§ə kæÿ
by pressing the Compose key followed by a predefined sequence of keys. Here are some good references:
http://en.wikipedia.org/wiki/Compose_key
http://www.hermit.org/Linux/ComposeKeys.html
Anyway, first you need to choose which key you want to be the Compose key. Then, open a terminal and enter the command "xev" (without the quotes). A window called "Event Tester" will pop up. Make sure that it's focused by clicking on it and leaving the mouse cursor in it.
Now press and release the key that you want to become the Compose key. Remember or write down the number after the word "keycode" in the output (see below image):
Now open the file ".Xmodmap" (the name begins with a dot) in your home directory (create it if it isn't there already) with a text editor and type in the following line, replacing <keycode number> with the number you got in xev.
Code:
keycode <keycode number> = Multi_key
Code:
xmodmap ~/.Xmodmap
Here's some more information abotu the Compose key, including what characters you can type and how:
http://en.wikipedia.org/wiki/Compose_key
http://www.hermit.org/Linux/ComposeKeys.html
IMPORTANT: I can't guarantee that this will work for systems that use a GUI login manager, I don't know how those work. I can only guarantee that this will work with the "startx" command.
Total Comments 3
Comments
-
Thanks MTK358.
I used this in XFCE and it worked like a charm. Very useful post.Posted 04-30-2011 at 05:42 PM by lupusarcanus -
I use a variation on this (I just set the key mapping directly with 'xmodmap -e "keycode 108 = Multi_key"'; no .Xmodmap file) with SLiM and Xfce and it works pərfectly.
SLiM does use .xinitrc, though, so I'm not sure if this would work with gdm, kdm, xdm, etc., either.Posted 07-04-2011 at 09:04 AM by MrCode -
Thanks a lot MTK358. This information was a real time-saver!
Posted 08-12-2011 at 04:19 PM by Diantre