04-15-2021, 06:44 AM
I think we want to look at scancodes to start, not the keycodes they're mapped to. A scancode involves a row and column on the physical keyboard. https://en.wikipedia.org/wiki/Keyboard_layout
AKA keysyms
showkey -s will give scancodes. dumpkeys, loadkeys, keymaps, xmodmap are all involved.
showkey -s tells me that Esc has a scancode of 0x01 which I believe because of the rows and columns thing. But like most Linux documentation it may be 20 years old and wrong. Yup, the showkey man page is dated 1 Feb 1998. Some things and be old and still correct. Somewhere else it mentions some scenario where when you ask for scancodes they're generated from keycodes by applying an inverse mapping.
AKA keysyms
showkey -s will give scancodes. dumpkeys, loadkeys, keymaps, xmodmap are all involved.
showkey -s tells me that Esc has a scancode of 0x01 which I believe because of the rows and columns thing. But like most Linux documentation it may be 20 years old and wrong. Yup, the showkey man page is dated 1 Feb 1998. Some things and be old and still correct. Somewhere else it mentions some scenario where when you ask for scancodes they're generated from keycodes by applying an inverse mapping.