<sys/types.h> defines the u8_t and u16_t types, corresponding to 8 and 16 bit values. This header file contains the list of keys, prefixed by a INPUT_KEY_ prefix. The K macro (see below) automatically adds the INPUT_KEY_ prefix to the given key name. Input types from pages other than the key page are not supported by TTY.
"K(" k ") - Key" Maps to the entry for the key in the bitmap
"C(" c ") - Control" Maps to control code
"A(" c ") - Alt" Sets the eight bit
"CA(" c ") - Control-Alt" Short for "A(C(" c "))"
"L(" c ") - Caps Lock" Adds Caps Lock effect
These macros are used in a keymap source file to help define keys. So instead of writing 032 to put a CTRL-Z in the map you write "C('Z')" . The "L(" c ")" macro is used in column 0 to tell that the Caps Lock key is active for this key. (Caps Lock should only have effect on letters.) Similarly, some keys in column 0 have a N prefix to indicate that they are affected by the Num Lock key.
<minix/keymap.h> contains a large number of definitions for special keys, like function keys, and keys on the numeric keypad. They are:Modifier keys: LCTRL , RCTRL , LSHIFT , RSHIFT , LALT , RALT .
Special keys: HOME , END , UP , DOWN , LEFT , RIGHT , PGUP , PGDN , MID " (numeric '5')," MIN " (only with " A " or " C " prefix)," PLUS , INSRT , DEL .
Special keys affected by Num Lock: NHOME , NEND ", ..." NINSRT , NDEL .
ALT + numpad key: AHOME , AEND ", ...," AINSRT .
CTRL + numpad: CHOME , CEND ", ...," CINSRT .
Lock keys: CALOCK " (Caps Lock)," NLOCK " (Num Lock)," SLOCK " (Scroll Lock)."
Function keys: F1 ", ...," F12 .
ALT - function key: AF1 ", ...," AF12 .
CTRL - function key: CF1 ", ...," CF12 .
SHIFT - function key: SF1 ", ...," SF12 .
ALT - SHIFT - function key: ASF1 ", ...," ASF12 .
You can create your own keyboard mapping by copying one of the existing keymap source files (Standard Minix: drivers/tty/keymaps/*.src ) and modifying the desired keys. Once this has been done, you need to recompile the genmap.c file, either by adding a new entry to the Makefile, or by running the following commands:
cc -DKEYSRC=\e"keymap.src\e" genmap.c
After this, the keymap file can be generated by running:
"a.out > " keymap .map
The keymap can be loaded in the keyboard driver by:
"loadkeys " keymap .map
It is wise to first run loadkeys on one of the maps in /usr/lib/keymaps so that you can easily revert back to a known keymap with a few taps on the up-arrow key and pressing return. You will otherwise have to fix the keymap with a faulty keymap loaded into the keyboard driver, which is no fun.
When the keymap is to your satisfaction you can copy it to /etc/keymap to have it loaded automatically at reboot.
15 /etc/keymap Default keymap file