GNU/Linux text console, X11 not involved, indeed not even installed. Keyboard is US layout, keymap US default. Kernel version 2.20.x or later.
An application written in C is getting keyboard input in
translation mode, i.e. XLATE
or UNICODE
. When a key is
pressed, the application receives the corresponding
keystring. As an example, you press F1, the application
reads "\033[[A"
.
Before the kernel sends the keystring to the application, it must know which key is pressed, i.e. it must know its scancode. In the F1 example above, the scancode for the key pressed is 59 or 0x3b.
That's to say even when the keyboard is in translation mode,
the scancodes are held somewhere in memory. How can the
application access them without switching the keyboard to
RAW
or MEDIUMRAW
mode? A code snippet would help.