3 keymap \- keyboard maps
8 is the compressed mapping from keyboard scan codes to ASCII.
9 It is made from a keymap source file consisting of MAP_COLS columns
10 (MINIX assigns the value 6 to MAX_COLS, corresponding to key pressed,
11 key+SHIFT, key+LEFT_ALT, key+RIGHT_ALT, key+ALT+SHIFT and key+CTRL) and
12 NR_SCAN_CODES rows (MINIX assigns the value 0x80 to NR_SCAN_CODES,
13 corresponding to the number of scan codes to be provided by the keyboard),
14 and each element is 2 bytes in length (see u16_t in type definitions).
15 The low order byte corresponds to the character represented by the scan
16 code, and the high order byte corresponds to the special meaning (when
17 CAPS LOCK has effect, if it is a function key, etc.), which is converted to
18 binary keymap format using the
22 .SS "Types (general): <sys/types.h>"
23 <sys/types.h> defines the
27 types, corresponding to 8 and 16 bit values.
28 .SS "Macros: <minix/keymap.h>"
30 .BI "C(" c ") - Control"
36 .BI "CA(" c ") - Control-Alt"
40 .BI "L(" c ") - Caps Lock"
43 These macros are used in a keymap source file to help define keys. So
46 to put a CTRL-Z in the map you write
50 macro is used in column 0 to tell that the Caps Lock key is active for this
51 key. (Caps Lock should only have effect on letters.)
52 .SS "Definitions: <minix/keymap.h>"
53 <minix/keymap.h> contains a large number of definitions for special keys,
54 like function keys, and keys on the numeric keypad. They are:
56 Escape key and modifiers:
71 .BR MID " (numeric '5'),"
86 .BR CALOCK " (Caps Lock),"
87 .BR NLOCK " (Num Lock),"
88 .BR SLOCK " (Scroll Lock)."
102 SHIFT - function key:
106 ALT - SHIFT - function key:
110 There is one key definition that isn't a key at all:
112 This keycode is sent by the keyboard as an indicator that the next keycode
113 is special. For instance both ALT keys have the same keycode, but the right
114 ALT key is sent by the keyboard preceded by the EXTKEY keycode. The same is
115 true for the '/' key on the numeric pad versus the other '/' key on the US
116 keyboard. (On other keyboards this key may have a different symbol.) The
117 keyboard driver knows that a different key is presses if it is preceded by
119 .SS "Creating/changing keyboard mapping"
120 You can create your own keyboard mapping by copying one of the existing
121 keymap source files (Standard Minix:
122 .BR drivers/tty/keymaps/*.src )
123 and modifying the desired keys. Once this has been done, you need to
124 recompile the genmap.c file, either by adding a new entry to the Makefile,
125 or by running the following commands:
129 cc -DKEYSRC=\e"\fIkeymap\fP.src\e" genmap.c
135 file can be generated by running:
138 .BI "a.out > " keymap .map
141 The keymap can be loaded in the keyboard driver by:
144 .BI "loadkeys " keymap .map
147 It is wise to first run
149 on one of the maps in
151 so that you can easily revert back to a known keymap with a few taps on the
152 up-arrow key and pressing return. You will otherwise have to fix the keymap
153 with a faulty keymap loaded into the keyboard driver, which is no fun.
155 When the keymap is to your satisfaction you can copy it to
157 to have it loaded automatically at reboot.
165 Victor A. Rodriguez - El bit Fantasma (Bit-Man@Tasa.Com.AR)