You are not logged in.

#1 2010-08-08 02:44:10

kcirick
Member
Registered: 2010-06-21
Posts: 364

[Solved] Typing Accents/Umlauts using AltGr

Hello,

I have a normal US layout keyboard and I'm wanting to type accents and umlauts. Searching on Google/Forum shows numerous solutions using AltGr (which, as I understand, is the right alt key), but this does nothing (AltGr+semicolon+u does not produce to u-umlaut). For all cases, it seems that this solution works out of the box, so I'm not sure where I'm going wrong. Here is the keyboard section of /etc/X11/xorg.conf

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option         "XkbLayout"  "en"
    Option         "XkbVariant" "altgr-intl"
EndSection

The only thing it might interfere is that I'm using SCIM (which I do need to type Japanese), and in my ~/.bashrc I have:

export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="scim"

Could someone please point me in the right direction? Thank you!

Last edited by kcirick (2010-08-08 04:21:47)

Offline

#2 2010-08-08 03:08:16

frabjous
Member
Registered: 2010-07-13
Posts: 367

Re: [Solved] Typing Accents/Umlauts using AltGr

I think what you want is the "Compose Key" also known as the "Multi key".

You could try adding:

Option "XkbOptions" "compose:rwin"

to the InputDevice section of /etc/X11/xorg.conf or perhaps /etc/X11/XF86Config. I know others have got it to work that way, but personally it didn't for me.

I solved this instead by adding:

xmodmap -e "keycode 108 = Multi_key"

to my .xinitrc to remap the right alt on my keyboard to the Compose Key (which is now all it does); but you'll need to make sure that your keyboard is laid out similarly to mine. Running xmodmap -pke may help you figure out how things are currently laid out, and check if anything else is currently mapped to the Compose Key (Multi_key).

GNOME provides a GUI for setting the Compose Key too in its Keyboard layout section if you happen to be using GNOME.

Last edited by frabjous (2010-08-08 03:09:12)

Offline

#3 2010-08-08 04:01:34

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: [Solved] Typing Accents/Umlauts using AltGr

Thanks for those suggestions, but I'm still having difficulty. I've added

Option "XkbOptions" "compose:rwin"

to /etc/X11/xorg.conf, and I've also added

xmodmap -e "keycode 126 = Multi_key"
xmodmap -e "keycode 100 = Alt_R"

to ~/.xinitrc (from running showkey, keycode 126 was my right windows key. I also found out that keycode 100 is my right alt key, and 108 is down arrow key). Neither of them are working. Furthermore, this is the output of running xmodmap -pke:

$ xmodmap -pke | grep Alt_R
keycode 100 = Alt_R NoSymbol Alt_R
keycode 108 = Alt_R Meta_R Alt_R Meta_R
$ xmodmap -pke | grep Multi_key
keycode 126 = Multi_key NoSymbol Multi_key

As you can see, keycode 100 and keycode 108 are both mapped to Alt_R. Could this explain why AltGr is not working?

Last edited by kcirick (2010-08-08 04:03:14)

Offline

#4 2010-08-08 04:20:51

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: [Solved] Typing Accents/Umlauts using AltGr

Solved.

It turns out that the keycode number given from showkey is different from that from xmodmap. I looked closer at the output of xmodmap -pke and found out it doesn't start from keycode 0, but it starts from keycode 5, so when showkey says the the rwin key is keycode 126, it doesn't correspond to keycode 126 on xmodmap (it turns out it belongs to keycode 134). So I changed in ~/.xinitrc

xmodmap -e "keycode 134 = Multi_key"

and everything goes very smoothly. I can now type accents and umlauts without problems.

Thanks frabjous for your input! it was very helpful! Danke schön

Last edited by kcirick (2010-08-08 04:23:31)

Offline

Board footer

Powered by FluxBB