If the above answers still do not work you then run xev -event keyboard
(you may need to install it first) and press AltGr with the Event Tester window in focus. You should see something like the following in the shell.
KeyPress event, serial 163, synthetic NO, window 0x1600001,
root 0x119, subw 0x0, time 21667560, (151,737), root:(1111,764),
state 0x10, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
XKeysymToKeycode returns keycode: 92
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
On the third line it gives you the keycode and keysym name, which in my case is ISO_Level3_Shift
. Now run xmodmap
and check the output before doing
xmodmap -e "remove mod5 = ISO_Level3_Shift"
xmodmap -e "add mod1 = ISO_Level3_Shift"
where ISO_Level3_Shift
should be replaced with the correct key symbol if necessary. Finally you need to add this to your user rc script to make it persistent.
No that didn't work for me, fired up emacs and AltGr-v gives me “ instead of scrolling the page up as it would with alt-v. – ChrisInCambo – 2009-10-09T04:28:17.933
Those specific commands didn't work, or looking at the output of 'xmodmap' and moving the keysym didn't work? You can use 'xev' to help with this: run it, mouse over the window, and press modded keys. – ayrnieu – 2009-10-09T05:05:04.410
The command worked and here is the output of the xmodmap: shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Meta_L (0xcd) mod2 Num_Lock (0x4d) mod3
mod4 Super_L (0xce), Hyper_L (0xcf) mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb) – ChrisInCambo – 2009-10-09T05:11:08.127
Sorry for the mess, is seems like this site strips line breaks from comments. – ChrisInCambo – 2009-10-09T05:11:41.887
That output shows that you haven't cleared mod5, and that you haven't added Mode_switch to mod1. xmodmap -e changes like this are temporal: you can blow them away with setxkbmap, for instance. – ayrnieu – 2009-10-09T05:17:48.300
Sorry there was a reboot between when I entered the commands and recorded the output of xmodmap, maybe the changes aren't persistent? Anyway I've entered the command again and now xmodmap look like this:
shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x42) control Control_L (0x25), Control_R (0x69) mod1 Alt_L (0x40), Meta_L (0xcd), Mode_switch (0xcb) mod2 Num_Lock (0x4d) mod3
mod4 Super_L (0xce), Hyper_L (0xcf) mod5
So the changes are showing, but if I still can't do CTRL-ALT-DEL in Gnome or use meta commands in emacs using AltGr. – ChrisInCambo – 2009-10-09T05:34:15.647
And if you also xmodmap -e 'add mod1 = ISO_Level3_Shift' ? – ayrnieu – 2009-10-09T05:39:20.880
Yes thanks alot, that nailed it! Are those changes persistent or will I loose them when I reboot? – ChrisInCambo – 2009-10-09T06:08:30.617
They are not persistent. I've put them in ~/.xsession for xdm setups, but http://www.linuxtopia.org/online_books/linux_beginner_books/debian_linux_desktop_survival_guide/GDM_Startup.shtml suggests that you put them in ~/.gnomerc
– ayrnieu – 2009-10-09T06:10:35.463Ok I've now noticed a problem, gnome is behaving like the alt key is constantly pressed, when I hit v for example in nautilus it opens up the View menu. – ChrisInCambo – 2009-10-09T13:42:29.450
If you're sure that this is related, you might: try removing the mode_switch keysym; change the keycode to generate Alt or Meta keysyms instead of dealing with the modifier table at all (xmodmap usage is similar:
xmodmap -e 'keycode 123 = 4 5'
-- look throughxmodmap -pke
) – ayrnieu – 2009-10-09T14:37:55.763Ok cracked it with xmodmap -e 'keycode 203 = NoSymbol Meta_L NoSymbol Meta_L NoSymbol Meta_L'. If anyone else is trying this your key might not be 203, look for the key which calls Mode_switch and change it to the above. – ChrisInCambo – 2009-10-09T15:50:21.783