This question already has an answer here:
- How to get keycodes for xmodmap? 6 answers
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:
0x02as the keycode of 1
in xorg, the symblic name is
<AE01>, which has
10as its raw keycode, certainly not
$ 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?