1 | /* keymap.h - defines for keymapping Author: Marcus Hampel
|
---|
2 | */
|
---|
3 | #ifndef _SYS__KEYMAP_H
|
---|
4 | #define _SYS__KEYMAP_H
|
---|
5 |
|
---|
6 | #define C(c) ((c) & 0x1F) /* Map to control code */
|
---|
7 | #define A(c) ((c) | 0x80) /* Set eight bit (ALT) */
|
---|
8 | #define CA(c) A(C(c)) /* Control-Alt */
|
---|
9 | #define L(c) ((c) | HASCAPS) /* Add "Caps Lock has effect" attribute */
|
---|
10 |
|
---|
11 | #define EXT 0x0100 /* Normal function keys */
|
---|
12 | #define CTRL 0x0200 /* Control key */
|
---|
13 | #define SHIFT 0x0400 /* Shift key */
|
---|
14 | #define ALT 0x0800 /* Alternate key */
|
---|
15 | #define EXTKEY 0x1000 /* extended keycode */
|
---|
16 | #define HASCAPS 0x8000 /* Caps Lock has effect */
|
---|
17 |
|
---|
18 | /* Scan code conversion. */
|
---|
19 | #define KEY_RELEASE 0200
|
---|
20 | #define ASCII_MASK 0177
|
---|
21 |
|
---|
22 | /* Numeric keypad */
|
---|
23 | #define HOME (0x01 + EXT)
|
---|
24 | #define END (0x02 + EXT)
|
---|
25 | #define UP (0x03 + EXT)
|
---|
26 | #define DOWN (0x04 + EXT)
|
---|
27 | #define LEFT (0x05 + EXT)
|
---|
28 | #define RIGHT (0x06 + EXT)
|
---|
29 | #define PGUP (0x07 + EXT)
|
---|
30 | #define PGDN (0x08 + EXT)
|
---|
31 | #define MID (0x09 + EXT)
|
---|
32 | #define NMIN (0x0A + EXT)
|
---|
33 | #define PLUS (0x0B + EXT)
|
---|
34 | #define INSRT (0x0C + EXT)
|
---|
35 |
|
---|
36 | /* Alt + Numeric keypad */
|
---|
37 | #define AHOME (0x01 + ALT)
|
---|
38 | #define AEND (0x02 + ALT)
|
---|
39 | #define AUP (0x03 + ALT)
|
---|
40 | #define ADOWN (0x04 + ALT)
|
---|
41 | #define ALEFT (0x05 + ALT)
|
---|
42 | #define ARIGHT (0x06 + ALT)
|
---|
43 | #define APGUP (0x07 + ALT)
|
---|
44 | #define APGDN (0x08 + ALT)
|
---|
45 | #define AMID (0x09 + ALT)
|
---|
46 | #define ANMIN (0x0A + ALT)
|
---|
47 | #define APLUS (0x0B + ALT)
|
---|
48 | #define AINSRT (0x0C + ALT)
|
---|
49 |
|
---|
50 | /* Ctrl + Numeric keypad */
|
---|
51 | #define CHOME (0x01 + CTRL)
|
---|
52 | #define CEND (0x02 + CTRL)
|
---|
53 | #define CUP (0x03 + CTRL)
|
---|
54 | #define CDOWN (0x04 + CTRL)
|
---|
55 | #define CLEFT (0x05 + CTRL)
|
---|
56 | #define CRIGHT (0x06 + CTRL)
|
---|
57 | #define CPGUP (0x07 + CTRL)
|
---|
58 | #define CPGDN (0x08 + CTRL)
|
---|
59 | #define CMID (0x09 + CTRL)
|
---|
60 | #define CNMIN (0x0A + CTRL)
|
---|
61 | #define CPLUS (0x0B + CTRL)
|
---|
62 | #define CINSRT (0x0C + CTRL)
|
---|
63 |
|
---|
64 | /* Lock keys */
|
---|
65 | #define CALOCK (0x0D + EXT) /* caps lock */
|
---|
66 | #define NLOCK (0x0E + EXT) /* number lock */
|
---|
67 | #define SLOCK (0x0F + EXT) /* scroll lock */
|
---|
68 |
|
---|
69 | /* Function keys */
|
---|
70 | #define F1 (0x10 + EXT)
|
---|
71 | #define F2 (0x11 + EXT)
|
---|
72 | #define F3 (0x12 + EXT)
|
---|
73 | #define F4 (0x13 + EXT)
|
---|
74 | #define F5 (0x14 + EXT)
|
---|
75 | #define F6 (0x15 + EXT)
|
---|
76 | #define F7 (0x16 + EXT)
|
---|
77 | #define F8 (0x17 + EXT)
|
---|
78 | #define F9 (0x18 + EXT)
|
---|
79 | #define F10 (0x19 + EXT)
|
---|
80 | #define F11 (0x1A + EXT)
|
---|
81 | #define F12 (0x1B + EXT)
|
---|
82 |
|
---|
83 | /* Alt+Fn */
|
---|
84 | #define AF1 (0x10 + ALT)
|
---|
85 | #define AF2 (0x11 + ALT)
|
---|
86 | #define AF3 (0x12 + ALT)
|
---|
87 | #define AF4 (0x13 + ALT)
|
---|
88 | #define AF5 (0x14 + ALT)
|
---|
89 | #define AF6 (0x15 + ALT)
|
---|
90 | #define AF7 (0x16 + ALT)
|
---|
91 | #define AF8 (0x17 + ALT)
|
---|
92 | #define AF9 (0x18 + ALT)
|
---|
93 | #define AF10 (0x19 + ALT)
|
---|
94 | #define AF11 (0x1A + ALT)
|
---|
95 | #define AF12 (0x1B + ALT)
|
---|
96 |
|
---|
97 | /* Ctrl+Fn */
|
---|
98 | #define CF1 (0x10 + CTRL)
|
---|
99 | #define CF2 (0x11 + CTRL)
|
---|
100 | #define CF3 (0x12 + CTRL)
|
---|
101 | #define CF4 (0x13 + CTRL)
|
---|
102 | #define CF5 (0x14 + CTRL)
|
---|
103 | #define CF6 (0x15 + CTRL)
|
---|
104 | #define CF7 (0x16 + CTRL)
|
---|
105 | #define CF8 (0x17 + CTRL)
|
---|
106 | #define CF9 (0x18 + CTRL)
|
---|
107 | #define CF10 (0x19 + CTRL)
|
---|
108 | #define CF11 (0x1A + CTRL)
|
---|
109 | #define CF12 (0x1B + CTRL)
|
---|
110 |
|
---|
111 | /* Shift+Fn */
|
---|
112 | #define SF1 (0x10 + SHIFT)
|
---|
113 | #define SF2 (0x11 + SHIFT)
|
---|
114 | #define SF3 (0x12 + SHIFT)
|
---|
115 | #define SF4 (0x13 + SHIFT)
|
---|
116 | #define SF5 (0x14 + SHIFT)
|
---|
117 | #define SF6 (0x15 + SHIFT)
|
---|
118 | #define SF7 (0x16 + SHIFT)
|
---|
119 | #define SF8 (0x17 + SHIFT)
|
---|
120 | #define SF9 (0x18 + SHIFT)
|
---|
121 | #define SF10 (0x19 + SHIFT)
|
---|
122 | #define SF11 (0x1A + SHIFT)
|
---|
123 | #define SF12 (0x1B + SHIFT)
|
---|
124 |
|
---|
125 | /* Alt+Shift+Fn */
|
---|
126 | #define ASF1 (0x10 + ALT + SHIFT)
|
---|
127 | #define ASF2 (0x11 + ALT + SHIFT)
|
---|
128 | #define ASF3 (0x12 + ALT + SHIFT)
|
---|
129 | #define ASF4 (0x13 + ALT + SHIFT)
|
---|
130 | #define ASF5 (0x14 + ALT + SHIFT)
|
---|
131 | #define ASF6 (0x15 + ALT + SHIFT)
|
---|
132 | #define ASF7 (0x16 + ALT + SHIFT)
|
---|
133 | #define ASF8 (0x17 + ALT + SHIFT)
|
---|
134 | #define ASF9 (0x18 + ALT + SHIFT)
|
---|
135 | #define ASF10 (0x19 + ALT + SHIFT)
|
---|
136 | #define ASF11 (0x1A + ALT + SHIFT)
|
---|
137 | #define ASF12 (0x1B + ALT + SHIFT)
|
---|
138 |
|
---|
139 | #define MAP_COLS 6 /* Number of columns in keymap */
|
---|
140 | #define NR_SCAN_CODES 0x80 /* Number of scan codes (rows in keymap) */
|
---|
141 |
|
---|
142 | typedef unsigned short keymap_t[NR_SCAN_CODES * MAP_COLS];
|
---|
143 |
|
---|
144 | #define KEY_MAGIC "KMAZ" /* Magic number of keymap file */
|
---|
145 |
|
---|
146 | #endif /* _SYS__KEYMAP_H */
|
---|