With showkey you can see what keycodes are produced on the console. The keycodes are the result of a translation of the scancodes, which are the actual output of the keyboard. The scancodes can be made visible by showkey -s, and by getkeycodes.
The system keymap is the translation table which converts keycodes to strings. The system keymap is a plain ASCII file which is loaded by loadkeys (use dumpkeys to show it).
+--------+
[TouchScreen] => | Kernel | ---> [tslib] ---> [tssimd.h/.c] ---> [tslib] =>
+--------+ A
|
|
ptrevent() |
VNC => [fbvncserver.h/.c] ------------------------+
keyevent() |
| keysym2scancode()
|
V
|---- uinput ----|
|---- event -----|
|-- kbd driver --| (translates the scancodes again)
|---kbd/bios/firmware---|-----------------+-----kernel-----+---------------| =>
#:> dumpkeys --long-info #:> getkeycodes
additional thanks to
./configure --host=i686-linux
The core of this SW is LibVNCServer .