source: trunk/minix/man/man5/keymap.5@ 20

Last change on this file since 20 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 4.1 KB
Line 
1.TH KEYMAP 5
2.SH NAME
3keymap \- keyboard maps
4.SH SYNOPSIS
5.B /etc/keymap
6.SH DESCRIPTION
7.B /etc/keymap
8is the compressed mapping from keyboard scan codes to ASCII.
9It 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,
11key+SHIFT, key+LEFT_ALT, key+RIGHT_ALT, key+ALT+SHIFT and key+CTRL) and
12NR_SCAN_CODES rows (MINIX assigns the value 0x80 to NR_SCAN_CODES,
13corresponding to the number of scan codes to be provided by the keyboard),
14and each element is 2 bytes in length (see u16_t in type definitions).
15The low order byte corresponds to the character represented by the scan
16code, and the high order byte corresponds to the special meaning (when
17CAPS LOCK has effect, if it is a function key, etc.), which is converted to
18binary keymap format using the
19.BR genmap
20utility.
21.PP
22.SS "Types (general): <sys/types.h>"
23<sys/types.h> defines the
24.B u8_t
25and
26.B u16_t
27types, corresponding to 8 and 16 bit values.
28.SS "Macros: <minix/keymap.h>"
29.TP
30.BI "C(" c ") - Control"
31Maps to control code
32.TP
33.BI "A(" c ") - Alt"
34Sets the eight bit
35.TP
36.BI "CA(" c ") - Control-Alt"
37Short for
38.BI "A(C(" c "))"
39.TP
40.BI "L(" c ") - Caps Lock"
41Adds Caps Lock effect
42.PP
43These macros are used in a keymap source file to help define keys. So
44instead of writing
45.B 032
46to put a CTRL-Z in the map you write
47.BR "C('Z')" .
48The
49.BI "L(" c ")"
50macro is used in column 0 to tell that the Caps Lock key is active for this
51key. (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,
54like function keys, and keys on the numeric keypad. They are:
55.PP
56Escape key and modifiers:
57.BR EXT ,
58.BR CTRL ,
59.BR SHIFT ,
60.BR ALT .
61.PP
62Numeric 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
75ALT + numpad key:
76.BR AHOME ,
77.BR AEND ", ...,"
78.BR AINSRT .
79.PP
80CTRL + numpad:
81.BR CHOME ,
82.BR CEND ", ...,"
83.BR CINSRT .
84.PP
85Lock keys:
86.BR CALOCK " (Caps Lock),"
87.BR NLOCK " (Num Lock),"
88.BR SLOCK " (Scroll Lock)."
89.PP
90Function keys:
91.BR F1 ", ...,"
92.BR F12 .
93.PP
94ALT - function key:
95.BR AF1 ", ...,"
96.BR AF12 .
97.PP
98CTRL - function key:
99.BR CF1 ", ...,"
100.BR CF12 .
101.PP
102SHIFT - function key:
103.BR SF1 ", ...,"
104.BR SF12 .
105.PP
106ALT - SHIFT - function key:
107.BR ASF1 ", ...,"
108.BR ASF12 .
109.PP
110There is one key definition that isn't a key at all:
111.BR EXTKEY .
112This keycode is sent by the keyboard as an indicator that the next keycode
113is special. For instance both ALT keys have the same keycode, but the right
114ALT key is sent by the keyboard preceded by the EXTKEY keycode. The same is
115true for the '/' key on the numeric pad versus the other '/' key on the US
116keyboard. (On other keyboards this key may have a different symbol.) The
117keyboard driver knows that a different key is presses if it is preceded by
118EXTKEY.
119.SS "Creating/changing keyboard mapping"
120You can create your own keyboard mapping by copying one of the existing
121keymap source files (Standard Minix:
122.BR kernel/keymaps/*.src ,
123Minix-vmd:
124.BR kernel/ibm/keymaps/*.src )
125and modifying the desired keys. Once this has been done, you need to
126recompile the genmap.c file, either by adding a new entry to the Makefile,
127or by running the following commands:
128.PP
129.RS
130.ft B
131cc -DKEYSRC=\e"\fIkeymap\fP.src\e" genmap.c
132.ft P
133.RE
134.PP
135After this, the
136.BR keymap
137file can be generated by running:
138.PP
139.RS
140.BI "a.out > " keymap .map
141.RE
142.PP
143The keymap can be loaded in the keyboard driver by:
144.PP
145.RS
146.BI "loadkeys " keymap .map
147.RE
148.PP
149It is wise to first run
150.B loadkeys
151on one of the maps in
152.B /usr/lib/keymaps
153so that you can easily revert back to a known keymap with a few taps on the
154up-arrow key and pressing return. You will otherwise have to fix the keymap
155with a faulty keymap loaded into the keyboard driver, which is no fun.
156.PP
157When the keymap is to your satisfaction you can copy it to
158.B /etc/keymap
159to have it loaded automatically at reboot.
160.SH FILES
161.TP 15
162.B /etc/keymap
163Default keymap file
164.SH "SEE ALSO"
165.B loadkeys (1).
166.SH AUTHOR
167Victor A. Rodriguez - El bit Fantasma (Bit-Man@Tasa.Com.AR)
Note: See TracBrowser for help on using the repository browser.