[9] | 1 | .TH KEYMAP 5
|
---|
| 2 | .SH NAME
|
---|
| 3 | keymap \- keyboard maps
|
---|
| 4 | .SH SYNOPSIS
|
---|
| 5 | .B /etc/keymap
|
---|
| 6 | .SH DESCRIPTION
|
---|
| 7 | .B /etc/keymap
|
---|
| 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
|
---|
| 19 | .BR genmap
|
---|
| 20 | utility.
|
---|
| 21 | .PP
|
---|
| 22 | .SS "Types (general): <sys/types.h>"
|
---|
| 23 | <sys/types.h> defines the
|
---|
| 24 | .B u8_t
|
---|
| 25 | and
|
---|
| 26 | .B u16_t
|
---|
| 27 | types, corresponding to 8 and 16 bit values.
|
---|
| 28 | .SS "Macros: <minix/keymap.h>"
|
---|
| 29 | .TP
|
---|
| 30 | .BI "C(" c ") - Control"
|
---|
| 31 | Maps to control code
|
---|
| 32 | .TP
|
---|
| 33 | .BI "A(" c ") - Alt"
|
---|
| 34 | Sets the eight bit
|
---|
| 35 | .TP
|
---|
| 36 | .BI "CA(" c ") - Control-Alt"
|
---|
| 37 | Short for
|
---|
| 38 | .BI "A(C(" c "))"
|
---|
| 39 | .TP
|
---|
| 40 | .BI "L(" c ") - Caps Lock"
|
---|
| 41 | Adds Caps Lock effect
|
---|
| 42 | .PP
|
---|
| 43 | These macros are used in a keymap source file to help define keys. So
|
---|
| 44 | instead of writing
|
---|
| 45 | .B 032
|
---|
| 46 | to put a CTRL-Z in the map you write
|
---|
| 47 | .BR "C('Z')" .
|
---|
| 48 | The
|
---|
| 49 | .BI "L(" c ")"
|
---|
| 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:
|
---|
| 55 | .PP
|
---|
| 56 | Escape key and modifiers:
|
---|
| 57 | .BR EXT ,
|
---|
| 58 | .BR CTRL ,
|
---|
| 59 | .BR SHIFT ,
|
---|
| 60 | .BR ALT .
|
---|
| 61 | .PP
|
---|
| 62 | Numeric keypad keys:
|
---|
| 63 | .BR HOME ,
|
---|
| 64 | .BR END ,
|
---|
| 65 | .BR UP ,
|
---|
| 66 | .BR DOWN ,
|
---|
| 67 | .BR LEFT ,
|
---|
| 68 | .BR RIGHT ,
|
---|
| 69 | .BR PGUP ,
|
---|
| 70 | .BR PGDN ,
|
---|
| 71 | .BR MID " (numeric '5'),"
|
---|
| 72 | .BR PLUS ,
|
---|
| 73 | .BR INSRT .
|
---|
| 74 | .PP
|
---|
| 75 | ALT + numpad key:
|
---|
| 76 | .BR AHOME ,
|
---|
| 77 | .BR AEND ", ...,"
|
---|
| 78 | .BR AINSRT .
|
---|
| 79 | .PP
|
---|
| 80 | CTRL + numpad:
|
---|
| 81 | .BR CHOME ,
|
---|
| 82 | .BR CEND ", ...,"
|
---|
| 83 | .BR CINSRT .
|
---|
| 84 | .PP
|
---|
| 85 | Lock keys:
|
---|
| 86 | .BR CALOCK " (Caps Lock),"
|
---|
| 87 | .BR NLOCK " (Num Lock),"
|
---|
| 88 | .BR SLOCK " (Scroll Lock)."
|
---|
| 89 | .PP
|
---|
| 90 | Function keys:
|
---|
| 91 | .BR F1 ", ...,"
|
---|
| 92 | .BR F12 .
|
---|
| 93 | .PP
|
---|
| 94 | ALT - function key:
|
---|
| 95 | .BR AF1 ", ...,"
|
---|
| 96 | .BR AF12 .
|
---|
| 97 | .PP
|
---|
| 98 | CTRL - function key:
|
---|
| 99 | .BR CF1 ", ...,"
|
---|
| 100 | .BR CF12 .
|
---|
| 101 | .PP
|
---|
| 102 | SHIFT - function key:
|
---|
| 103 | .BR SF1 ", ...,"
|
---|
| 104 | .BR SF12 .
|
---|
| 105 | .PP
|
---|
| 106 | ALT - SHIFT - function key:
|
---|
| 107 | .BR ASF1 ", ...,"
|
---|
| 108 | .BR ASF12 .
|
---|
| 109 | .PP
|
---|
| 110 | There is one key definition that isn't a key at all:
|
---|
| 111 | .BR EXTKEY .
|
---|
| 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
|
---|
| 118 | EXTKEY.
|
---|
| 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 kernel/keymaps/*.src ,
|
---|
| 123 | Minix-vmd:
|
---|
| 124 | .BR kernel/ibm/keymaps/*.src )
|
---|
| 125 | and modifying the desired keys. Once this has been done, you need to
|
---|
| 126 | recompile the genmap.c file, either by adding a new entry to the Makefile,
|
---|
| 127 | or by running the following commands:
|
---|
| 128 | .PP
|
---|
| 129 | .RS
|
---|
| 130 | .ft B
|
---|
| 131 | cc -DKEYSRC=\e"\fIkeymap\fP.src\e" genmap.c
|
---|
| 132 | .ft P
|
---|
| 133 | .RE
|
---|
| 134 | .PP
|
---|
| 135 | After this, the
|
---|
| 136 | .BR keymap
|
---|
| 137 | file can be generated by running:
|
---|
| 138 | .PP
|
---|
| 139 | .RS
|
---|
| 140 | .BI "a.out > " keymap .map
|
---|
| 141 | .RE
|
---|
| 142 | .PP
|
---|
| 143 | The keymap can be loaded in the keyboard driver by:
|
---|
| 144 | .PP
|
---|
| 145 | .RS
|
---|
| 146 | .BI "loadkeys " keymap .map
|
---|
| 147 | .RE
|
---|
| 148 | .PP
|
---|
| 149 | It is wise to first run
|
---|
| 150 | .B loadkeys
|
---|
| 151 | on one of the maps in
|
---|
| 152 | .B /usr/lib/keymaps
|
---|
| 153 | so that you can easily revert back to a known keymap with a few taps on the
|
---|
| 154 | up-arrow key and pressing return. You will otherwise have to fix the keymap
|
---|
| 155 | with a faulty keymap loaded into the keyboard driver, which is no fun.
|
---|
| 156 | .PP
|
---|
| 157 | When the keymap is to your satisfaction you can copy it to
|
---|
| 158 | .B /etc/keymap
|
---|
| 159 | to have it loaded automatically at reboot.
|
---|
| 160 | .SH FILES
|
---|
| 161 | .TP 15
|
---|
| 162 | .B /etc/keymap
|
---|
| 163 | Default keymap file
|
---|
| 164 | .SH "SEE ALSO"
|
---|
| 165 | .B loadkeys (1).
|
---|
| 166 | .SH AUTHOR
|
---|
| 167 | Victor A. Rodriguez - El bit Fantasma (Bit-Man@Tasa.Com.AR)
|
---|