On Thinkpad T400, my left Alt key has stopped working. Since I have never used the super key in LXDE in Ubuntu 16.04, I did the following to modify the super key as if it were the left Alt key.
First I need to find out the relevant information about the two keys by running xev
.
When I press the left Alt key, xev
doesn't output anything.
I can only deduce the information about the left Alt key from the right Alt key. When I press the right Alt key,
KeyPress event, serial 48, synthetic NO, window 0x2800001,
root 0xb2, subw 0x0, time 942676, (262,45), root:(264,68),
state 0x0, keycode 108 (keysym 0xffea, Alt_R), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 48, synthetic NO, window 0x2800001,
root 0xb2, subw 0x0, time 942812, (262,45), root:(264,68),
state 0x8, keycode 108 (keysym 0xffea, Alt_R), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
When I press the super key,
KeyPress event, serial 48, synthetic NO, window 0x2800001,
root 0xb2, subw 0x0, time 943386, (262,45), root:(264,68),
state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 48, synthetic NO, window 0x2800001,
root 0xb2, subw 0x0, time 943498, (262,45), root:(264,68),
state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
Then in a bash shell, after I run
xmodmap -e "keycode 133 = Alt_L"
the super key sometimes works as left Alt key, e.g.
- when I switch to the first tab of firefox by
Alt+1
(viasuper+1
).
But the super key sometimes doesn't work as left Alt key, e.g.
- when I switch to the first tab of
lxterminal
byAlt+1
(viasuper+1
), - when I want to switch between the windows of different applications by
Alt+tab
viasuper+tab
(strangely,Alt_R + tab
doesn't work either, althoughAlt_L + tab
worked when the left Alt key worked before). - when I work in Emacs, which requires to use Alt key a lot,
- When I want to invoke a program, by firstly
Alt + F2
viasuper + F2
- When I want to close the window of a program, by
Alt + F4
viasuper + F4
I was wondering why the super key doesn't work as the left Alt key in all the cases?
I followed https://unix.stackexchange.com/questions/86933/swap-alt-and-super/86936#86936 and https://askubuntu.com/a/296437/1471, but I might have missed something, and I also notice that they are trying to swap two working keys, instead of substitute one nonworking key with a working key.
Thanks.
remove Mod1 = Alt_L
andadd Mod1 = Super_L
– Lok Lam Cheng Apr 19 '18 at 14:07