The keyboard driver is made up several levels:
getkeycodes(8)
and setkeycodes(8)
utilities. You will only need to look at that
if you have some sort of non-standard (or programmable ?) keys on your
keyboard. AFAIK, these keycodes are the same among a set of keyboards
sharing the same hardware, but differing in the symbols drawn on the
keys.
loadkeys(1)
and dumpkeys(1)
utilities.The keyboard driver can be in one of 4 modes (which you can access
using kbd_mode(1)
), which will influence what type of data
applications will get as keyboard input:
K_RAW
) mode, in which the application gets
scancodes for input. It is used by applications that implement their
own keyboard driver. For example, X11 does that.
K_MEDIUMRAW
) mode, in which the application
gets information on which keys (identified by their keycodes) get
pressed and released. AFAIK, no real-life application uses this mode.
K_XLATE
) mode, in which the application
effectively gets the characters as defined by the keymap, using
an 8-bit encoding. In this mode, the Ascii_0
to Ascii_9
keymap symbols allow to compose characters by giving their decimal
8bit-code, and Hex_0
to Hex_F
do the same with (2-digit)
hexadecimal codes.
K_UNICODE
) mode, which at this time only
differs from the ASCII mode by allowing the user to compose UTF8
unicode characters by their decimal value, using Ascii_0 to Ascii_9
(who needs that ?), or their hexadecimal (4-digit) value, using Hex_0
to Hex_9. A keymap can be set up to produce UTF8 sequences (with a
U+XXXX
pseudo-symbol, where each X
is an hexadecimal digit),
but be warned that these UTF8 sequences will also be produced even in
ASCII mode. I think this is a bug in the kernel.BE WARNED that putting the keyboard in RAW
or MEDIUMRAW
mode will make it unusable for most applications. Use showkey(1)
to
get a demo of these special modes, or to find out what
scancodes/keycodes are produced by a specific key.
keytables(5)
, setleds(1)
, setmetamode(1)
.