At first glance, it seems /usr/share/X11/xkb/keycodes/ contains the mapping of raw keycodes reported by the device, and 'showkey --scancodes` command can return the scancode. It's easy to think that they are the same thing.
But they are evidently different.showkeys -scancodes
reliably returns the Linux Keycode, as in Linux Keycode Table converted to hex; while 'raw keycode' in xkb refer to are always different than the table.
Take the key 1 for example:
showkey --scancodes
returns0x02
as the keycode of 1in xorg, the symblic name is
<AE01>
, which has10
as its raw keycode, certainly not0x02
.$ grep AE01 /usr/share/X11/xkb/keycodes/evdev <AE01> = 10;
So, for the purpose of configuring xkb, how to find the raw keycode for any key, given that showkey --scancodes
is not suitable?
showkey
outputs has nothing to do with X. That's where I got it wrong. – Tankman六四 Aug 01 '17 at 06:54