1 /********************************************************************/
2 /*                                                                  */
3 /*  kbd_drv.h     Prototypes for keyboard access functions.         */
4 /*  Copyright (C) 1989 - 2005  Thomas Mertes                        */
5 /*                                                                  */
6 /*  This file is part of the Seed7 Runtime Library.                 */
7 /*                                                                  */
8 /*  The Seed7 Runtime Library is free software; you can             */
9 /*  redistribute it and/or modify it under the terms of the GNU     */
10 /*  Lesser General Public License as published by the Free Software */
11 /*  Foundation; either version 2.1 of the License, or (at your      */
12 /*  option) any later version.                                      */
13 /*                                                                  */
14 /*  The Seed7 Runtime Library is distributed in the hope that it    */
15 /*  will be useful, but WITHOUT ANY WARRANTY; without even the      */
16 /*  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
17 /*  PURPOSE.  See the GNU Lesser General Public License for more    */
18 /*  details.                                                        */
19 /*                                                                  */
20 /*  You should have received a copy of the GNU Lesser General       */
21 /*  Public License along with this program; if not, write to the    */
22 /*  Free Software Foundation, Inc., 51 Franklin Street,             */
23 /*  Fifth Floor, Boston, MA  02110-1301, USA.                       */
24 /*                                                                  */
25 /*  Module: Seed7 Runtime Library                                   */
26 /*  File: seed7/src/kbd_drv.h                                       */
27 /*  Changes: 1990, 1991, 1992, 1993, 1994, 2005  Thomas Mertes      */
28 /*  Content: Prototypes for keyboard access functions.              */
29 /*                                                                  */
30 /********************************************************************/
31 
32 #define CLOSE_BUTTON_CLOSES_PROGRAM   0
33 #define CLOSE_BUTTON_RETURNS_KEY      1
34 #define CLOSE_BUTTON_RAISES_EXCEPTION 2
35 
36 #define K_CTL_A        1
37 #define K_CTL_B        2
38 #define K_CTL_C        3
39 #define K_CTL_D        4
40 #define K_CTL_E        5
41 #define K_CTL_F        6
42 #define K_CTL_G        7
43 #define K_CTL_H        8
44 #define K_BS           8
45 #define K_CTL_I        9
46 #define K_TAB          9
47 #define K_CTL_J       10
48 #define K_NL          10
49 #define K_CTL_K       11
50 #define K_CTL_L       12
51 #define K_CTL_M       13
52 #define K_CTL_N       14
53 #define K_CTL_O       15
54 #define K_CTL_P       16
55 #define K_CTL_Q       17
56 #define K_CTL_R       18
57 #define K_CTL_S       19
58 #define K_CTL_T       20
59 #define K_CTL_U       21
60 #define K_CTL_V       22
61 #define K_CTL_W       23
62 #define K_CTL_X       24
63 #define K_CTL_Y       25
64 #define K_CTL_Z       26
65 #define K_ESC         27
66 
67 /* KEYCODE_BASE is beyond the range of Unicode characters */
68 #define KEYCODE_BASE 0x110000
69 
70 #define K_ALT_A      (KEYCODE_BASE +   1)
71 #define K_ALT_B      (KEYCODE_BASE +   2)
72 #define K_ALT_C      (KEYCODE_BASE +   3)
73 #define K_ALT_D      (KEYCODE_BASE +   4)
74 #define K_ALT_E      (KEYCODE_BASE +   5)
75 #define K_ALT_F      (KEYCODE_BASE +   6)
76 #define K_ALT_G      (KEYCODE_BASE +   7)
77 #define K_ALT_H      (KEYCODE_BASE +   8)
78 #define K_ALT_I      (KEYCODE_BASE +   9)
79 #define K_ALT_J      (KEYCODE_BASE +  10)
80 #define K_ALT_K      (KEYCODE_BASE +  11)
81 #define K_ALT_L      (KEYCODE_BASE +  12)
82 #define K_ALT_M      (KEYCODE_BASE +  13)
83 #define K_ALT_N      (KEYCODE_BASE +  14)
84 #define K_ALT_O      (KEYCODE_BASE +  15)
85 #define K_ALT_P      (KEYCODE_BASE +  16)
86 #define K_ALT_Q      (KEYCODE_BASE +  17)
87 #define K_ALT_R      (KEYCODE_BASE +  18)
88 #define K_ALT_S      (KEYCODE_BASE +  19)
89 #define K_ALT_T      (KEYCODE_BASE +  20)
90 #define K_ALT_U      (KEYCODE_BASE +  21)
91 #define K_ALT_V      (KEYCODE_BASE +  22)
92 #define K_ALT_W      (KEYCODE_BASE +  23)
93 #define K_ALT_X      (KEYCODE_BASE +  24)
94 #define K_ALT_Y      (KEYCODE_BASE +  25)
95 #define K_ALT_Z      (KEYCODE_BASE +  26)
96 #define K_CTL_0      (KEYCODE_BASE +  38)
97 #define K_CTL_1      (KEYCODE_BASE +  39)
98 #define K_CTL_2      (KEYCODE_BASE +  40)
99 #define K_CTL_3      (KEYCODE_BASE +  41)
100 #define K_CTL_4      (KEYCODE_BASE +  42)
101 #define K_CTL_5      (KEYCODE_BASE +  43)
102 #define K_CTL_6      (KEYCODE_BASE +  44)
103 #define K_CTL_7      (KEYCODE_BASE +  45)
104 #define K_CTL_8      (KEYCODE_BASE +  46)
105 #define K_CTL_9      (KEYCODE_BASE +  47)
106 #define K_ALT_0      (KEYCODE_BASE +  48)
107 #define K_ALT_1      (KEYCODE_BASE +  49)
108 #define K_ALT_2      (KEYCODE_BASE +  50)
109 #define K_ALT_3      (KEYCODE_BASE +  51)
110 #define K_ALT_4      (KEYCODE_BASE +  52)
111 #define K_ALT_5      (KEYCODE_BASE +  53)
112 #define K_ALT_6      (KEYCODE_BASE +  54)
113 #define K_ALT_7      (KEYCODE_BASE +  55)
114 #define K_ALT_8      (KEYCODE_BASE +  56)
115 #define K_ALT_9      (KEYCODE_BASE +  57)
116 #define K_F1         (KEYCODE_BASE +  64)
117 #define K_F2         (KEYCODE_BASE +  65)
118 #define K_F3         (KEYCODE_BASE +  66)
119 #define K_F4         (KEYCODE_BASE +  67)
120 #define K_F5         (KEYCODE_BASE +  68)
121 #define K_F6         (KEYCODE_BASE +  69)
122 #define K_F7         (KEYCODE_BASE +  70)
123 #define K_F8         (KEYCODE_BASE +  71)
124 #define K_F9         (KEYCODE_BASE +  72)
125 #define K_F10        (KEYCODE_BASE +  73)
126 #define K_F11        (KEYCODE_BASE +  74)
127 #define K_F12        (KEYCODE_BASE +  75)
128 #define K_SFT_F1     (KEYCODE_BASE +  80)
129 #define K_SFT_F2     (KEYCODE_BASE +  81)
130 #define K_SFT_F3     (KEYCODE_BASE +  82)
131 #define K_SFT_F4     (KEYCODE_BASE +  83)
132 #define K_SFT_F5     (KEYCODE_BASE +  84)
133 #define K_SFT_F6     (KEYCODE_BASE +  85)
134 #define K_SFT_F7     (KEYCODE_BASE +  86)
135 #define K_SFT_F8     (KEYCODE_BASE +  87)
136 #define K_SFT_F9     (KEYCODE_BASE +  88)
137 #define K_SFT_F10    (KEYCODE_BASE +  89)
138 #define K_SFT_F11    (KEYCODE_BASE +  90)
139 #define K_SFT_F12    (KEYCODE_BASE +  91)
140 #define K_CTL_F1     (KEYCODE_BASE +  96)
141 #define K_CTL_F2     (KEYCODE_BASE +  97)
142 #define K_CTL_F3     (KEYCODE_BASE +  98)
143 #define K_CTL_F4     (KEYCODE_BASE +  99)
144 #define K_CTL_F5     (KEYCODE_BASE + 100)
145 #define K_CTL_F6     (KEYCODE_BASE + 101)
146 #define K_CTL_F7     (KEYCODE_BASE + 102)
147 #define K_CTL_F8     (KEYCODE_BASE + 103)
148 #define K_CTL_F9     (KEYCODE_BASE + 104)
149 #define K_CTL_F10    (KEYCODE_BASE + 105)
150 #define K_CTL_F11    (KEYCODE_BASE + 106)
151 #define K_CTL_F12    (KEYCODE_BASE + 107)
152 #define K_ALT_F1     (KEYCODE_BASE + 112)
153 #define K_ALT_F2     (KEYCODE_BASE + 113)
154 #define K_ALT_F3     (KEYCODE_BASE + 114)
155 #define K_ALT_F4     (KEYCODE_BASE + 115)
156 #define K_ALT_F5     (KEYCODE_BASE + 116)
157 #define K_ALT_F6     (KEYCODE_BASE + 117)
158 #define K_ALT_F7     (KEYCODE_BASE + 118)
159 #define K_ALT_F8     (KEYCODE_BASE + 119)
160 #define K_ALT_F9     (KEYCODE_BASE + 120)
161 #define K_ALT_F10    (KEYCODE_BASE + 121)
162 #define K_ALT_F11    (KEYCODE_BASE + 122)
163 #define K_ALT_F12    (KEYCODE_BASE + 123)
164 #define K_LEFT           (KEYCODE_BASE + 160)
165 #define K_RIGHT          (KEYCODE_BASE + 161)
166 #define K_UP             (KEYCODE_BASE + 162)
167 #define K_DOWN           (KEYCODE_BASE + 163)
168 #define K_HOME           (KEYCODE_BASE + 164)
169 #define K_END            (KEYCODE_BASE + 165)
170 #define K_PGUP           (KEYCODE_BASE + 166)
171 #define K_PGDN           (KEYCODE_BASE + 167)
172 #define K_INS            (KEYCODE_BASE + 168)
173 #define K_DEL            (KEYCODE_BASE + 169)
174 #define K_PAD_CENTER     (KEYCODE_BASE + 170)
175 #define K_SFT_LEFT       (KEYCODE_BASE + 176)
176 #define K_SFT_RIGHT      (KEYCODE_BASE + 177)
177 #define K_SFT_UP         (KEYCODE_BASE + 178)
178 #define K_SFT_DOWN       (KEYCODE_BASE + 179)
179 #define K_SFT_HOME       (KEYCODE_BASE + 180)
180 #define K_SFT_END        (KEYCODE_BASE + 181)
181 #define K_SFT_PGUP       (KEYCODE_BASE + 182)
182 #define K_SFT_PGDN       (KEYCODE_BASE + 183)
183 #define K_SFT_INS        (KEYCODE_BASE + 184)
184 #define K_SFT_DEL        (KEYCODE_BASE + 185)
185 #define K_SFT_PAD_CENTER (KEYCODE_BASE + 186)
186 #define K_CTL_LEFT       (KEYCODE_BASE + 192)
187 #define K_CTL_RIGHT      (KEYCODE_BASE + 193)
188 #define K_CTL_UP         (KEYCODE_BASE + 194)
189 #define K_CTL_DOWN       (KEYCODE_BASE + 195)
190 #define K_CTL_HOME       (KEYCODE_BASE + 196)
191 #define K_CTL_END        (KEYCODE_BASE + 197)
192 #define K_CTL_PGUP       (KEYCODE_BASE + 198)
193 #define K_CTL_PGDN       (KEYCODE_BASE + 199)
194 #define K_CTL_INS        (KEYCODE_BASE + 200)
195 #define K_CTL_DEL        (KEYCODE_BASE + 201)
196 #define K_CTL_PAD_CENTER (KEYCODE_BASE + 202)
197 #define K_ALT_LEFT       (KEYCODE_BASE + 208)
198 #define K_ALT_RIGHT      (KEYCODE_BASE + 209)
199 #define K_ALT_UP         (KEYCODE_BASE + 210)
200 #define K_ALT_DOWN       (KEYCODE_BASE + 211)
201 #define K_ALT_HOME       (KEYCODE_BASE + 212)
202 #define K_ALT_END        (KEYCODE_BASE + 213)
203 #define K_ALT_PGUP       (KEYCODE_BASE + 214)
204 #define K_ALT_PGDN       (KEYCODE_BASE + 215)
205 #define K_ALT_INS        (KEYCODE_BASE + 216)
206 #define K_ALT_DEL        (KEYCODE_BASE + 217)
207 #define K_ALT_PAD_CENTER (KEYCODE_BASE + 218)
208 #define K_MENU           (KEYCODE_BASE + 228)
209 #define K_PRINT          (KEYCODE_BASE + 229)
210 #define K_PAUSE          (KEYCODE_BASE + 230)
211 #define K_SFT_NL         (KEYCODE_BASE + 240)
212 #define K_SFT_BS         (KEYCODE_BASE + 241)
213 #define K_SFT_TAB        (KEYCODE_BASE + 242)
214 #define K_BACKTAB        K_SFT_TAB
215 #define K_SFT_ESC        (KEYCODE_BASE + 243)
216 #define K_SFT_MENU       (KEYCODE_BASE + 244)
217 #define K_SFT_PRINT      (KEYCODE_BASE + 245)
218 #define K_SFT_PAUSE      (KEYCODE_BASE + 246)
219 #define K_CTL_NL         (KEYCODE_BASE + 256)
220 #define K_CTL_BS         (KEYCODE_BASE + 257)
221 #define K_CTL_TAB        (KEYCODE_BASE + 258)
222 #define K_CTL_ESC        (KEYCODE_BASE + 259)
223 #define K_CTL_MENU       (KEYCODE_BASE + 260)
224 #define K_CTL_PRINT      (KEYCODE_BASE + 261)
225 #define K_CTL_PAUSE      (KEYCODE_BASE + 262)
226 #define K_ALT_NL         (KEYCODE_BASE + 272)
227 #define K_ALT_BS         (KEYCODE_BASE + 273)
228 #define K_ALT_TAB        (KEYCODE_BASE + 274)
229 #define K_ALT_ESC        (KEYCODE_BASE + 275)
230 #define K_ALT_MENU       (KEYCODE_BASE + 276)
231 #define K_ALT_PRINT      (KEYCODE_BASE + 277)
232 #define K_ALT_PAUSE      (KEYCODE_BASE + 278)
233 #define K_SCRLUP         (KEYCODE_BASE + 288)
234 #define K_SCRLDN         (KEYCODE_BASE + 289)
235 #define K_INSLN          (KEYCODE_BASE + 290)
236 #define K_DELLN          (KEYCODE_BASE + 291)
237 #define K_ERASE          (KEYCODE_BASE + 292)
238 #define K_NULCHAR        (KEYCODE_BASE + 293)
239 #define K_NULLCMD        (KEYCODE_BASE + 294)
240 #define K_REDRAW         (KEYCODE_BASE + 295)
241 #define K_MOUSE1         (KEYCODE_BASE + 304)
242 #define K_MOUSE2         (KEYCODE_BASE + 305)
243 #define K_MOUSE3         (KEYCODE_BASE + 306)
244 #define K_MOUSE4         (KEYCODE_BASE + 307)
245 #define K_MOUSE5         (KEYCODE_BASE + 308)
246 #define K_MOUSE_FWD      (KEYCODE_BASE + 309)
247 #define K_MOUSE_BACK     (KEYCODE_BASE + 310)
248 #define K_SFT_MOUSE1     (KEYCODE_BASE + 320)
249 #define K_SFT_MOUSE2     (KEYCODE_BASE + 321)
250 #define K_SFT_MOUSE3     (KEYCODE_BASE + 322)
251 #define K_SFT_MOUSE4     (KEYCODE_BASE + 323)
252 #define K_SFT_MOUSE5     (KEYCODE_BASE + 324)
253 #define K_SFT_MOUSE_FWD  (KEYCODE_BASE + 325)
254 #define K_SFT_MOUSE_BACK (KEYCODE_BASE + 326)
255 #define K_CTL_MOUSE1     (KEYCODE_BASE + 336)
256 #define K_CTL_MOUSE2     (KEYCODE_BASE + 337)
257 #define K_CTL_MOUSE3     (KEYCODE_BASE + 338)
258 #define K_CTL_MOUSE4     (KEYCODE_BASE + 339)
259 #define K_CTL_MOUSE5     (KEYCODE_BASE + 340)
260 #define K_CTL_MOUSE_FWD  (KEYCODE_BASE + 341)
261 #define K_CTL_MOUSE_BACK (KEYCODE_BASE + 342)
262 #define K_ALT_MOUSE1     (KEYCODE_BASE + 352)
263 #define K_ALT_MOUSE2     (KEYCODE_BASE + 353)
264 #define K_ALT_MOUSE3     (KEYCODE_BASE + 354)
265 #define K_ALT_MOUSE4     (KEYCODE_BASE + 355)
266 #define K_ALT_MOUSE5     (KEYCODE_BASE + 356)
267 #define K_ALT_MOUSE_FWD  (KEYCODE_BASE + 357)
268 #define K_ALT_MOUSE_BACK (KEYCODE_BASE + 358)
269 #define K_SHIFT          (KEYCODE_BASE + 368)
270 #define K_LEFT_SHIFT     (KEYCODE_BASE + 369)
271 #define K_RIGHT_SHIFT    (KEYCODE_BASE + 370)
272 #define K_CONTROL        (KEYCODE_BASE + 371)
273 #define K_LEFT_CONTROL   (KEYCODE_BASE + 372)
274 #define K_RIGHT_CONTROL  (KEYCODE_BASE + 373)
275 #define K_ALT            (KEYCODE_BASE + 374)
276 #define K_LEFT_ALT       (KEYCODE_BASE + 375)
277 #define K_RIGHT_ALT      (KEYCODE_BASE + 376)
278 #define K_SHIFT_LOCK     (KEYCODE_BASE + 377)
279 #define K_SHIFT_LOCK_ON  (KEYCODE_BASE + 378)
280 #define K_NUM_LOCK       (KEYCODE_BASE + 379)
281 #define K_NUM_LOCK_ON    (KEYCODE_BASE + 380)
282 #define K_SCROLL_LOCK    (KEYCODE_BASE + 381)
283 #define K_SCROLL_LOCK_ON (KEYCODE_BASE + 382)
284 #define K_CLOSE          (KEYCODE_BASE + 385)
285 #define K_RESIZE         (KEYCODE_BASE + 386)
286 #define K_UNDEF          (KEYCODE_BASE + 387)
287 #define K_NONE           (KEYCODE_BASE + 388)
288 
289 
290 charType kbdGetc (void);
291 boolType kbdKeyPressed (void);
292 charType kbdRawGetc (void);
293 void kbdShut (void);
294