Problem :
I have a problem with a faulty laptop keyboard. When I open the terminal I can see:
^[[17~^[[17~^[[17~^[[17~user@computer:~$ ~~~~~~~~ [...]
and so on with an infinite number of tilde symbols.
xev shows 72-keycode events.
However if I leave open a gedit window, no character appears.
How can I detect which key is being “pressed”?
Solution :
xev
shows 72-keycode events. […] How can I detect which key is being “pressed”?
In my Kubuntu 16.04.3 LTS xev
shows not only keykodes. The key with keycode 72, while being constantly pressed, makes xev
repeat the following output:
KeyPress event, serial 40, synthetic NO, window 0x3c00001,
root 0x2c4, subw 0x0, time 2544694, (173,-21), root:(173,8),
state 0x10, keycode 72 (keysym 0xffc3, F6), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 40, synthetic NO, window 0x3c00001,
root 0x2c4, subw 0x0, time 2544732, (173,-21), root:(173,8),
state 0x10, keycode 72 (keysym 0xffc3, F6), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
Important line with explanation:
state 0x10, keycode 72 (keysym 0xffc3, F6), same_screen YES,
keycode obviously ^^ ^^ human-readable name
So it’s F6.