comparison src/video/qnxgf/SDL_hiddi_keyboard.h @ 3109:7b3a09fb9c8b

Support for HID devices (mice and keyboards only for now) has been added
author Mike Gorchak <lestat@i.com.ua>
date Tue, 28 Apr 2009 04:33:30 +0000
parents
children 7f684f249ec9
comparison
equal deleted inserted replaced
3108:aa1897bee1e9 3109:7b3a09fb9c8b
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2009 Sam Lantinga
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19 Sam Lantinga
20 slouken@libsdl.org
21
22 QNX Graphics Framework SDL driver
23 Copyright (C) 2009 Mike Gorchak
24 (mike@malva.ua, lestat@i.com.ua)
25 */
26
27 #ifndef __SDL_HIDDI_KEYBOARD_H__
28 #define __SDL_HIDDI_KEYBOARD_H__
29
30 #include <inttypes.h>
31
32 /* PS/2 and USB keyboards are generating this packet */
33 typedef struct key_packet
34 {
35 uint8_t modifiers;
36 uint8_t data;
37 uint8_t codes[6];
38 } key_packet;
39
40 /* Key modifier codes */
41 #define HIDDI_MKEY_LEFT_CTRL 0x00000001
42 #define HIDDI_MKEY_LEFT_SHIFT 0x00000002
43 #define HIDDI_MKEY_LEFT_ALT 0x00000004
44 #define HIDDI_MKEY_LEFT_WFLAG 0x00000008
45 #define HIDDI_MKEY_RIGHT_CTRL 0x00000010
46 #define HIDDI_MKEY_RIGHT_SHIFT 0x00000020
47 #define HIDDI_MKEY_RIGHT_ALT 0x00000040
48 #define HIDDI_MKEY_RIGHT_WFLAG 0x00000080
49
50 /* Key codes */
51 #define HIDDI_KEY_UNPRESSED 0x00000000
52 #define HIDDI_KEY_OVERFLOW 0x00000001
53 #define HIDDI_KEY_ESC 0x00000029
54 #define HIDDI_KEY_F1 0x0000003A
55 #define HIDDI_KEY_F2 0x0000003B
56 #define HIDDI_KEY_F3 0x0000003C
57 #define HIDDI_KEY_F4 0x0000003D
58 #define HIDDI_KEY_F5 0x0000003E
59 #define HIDDI_KEY_F6 0x0000003F
60 #define HIDDI_KEY_F7 0x00000040
61 #define HIDDI_KEY_F8 0x00000041
62 #define HIDDI_KEY_F9 0x00000042
63 #define HIDDI_KEY_F10 0x00000043
64 #define HIDDI_KEY_F11 0x00000044
65 #define HIDDI_KEY_F12 0x00000045
66
67 #define HIDDI_KEY_BACKQUOTE 0x00000035
68 #define HIDDI_KEY_1 0x0000001E
69 #define HIDDI_KEY_2 0x0000001F
70 #define HIDDI_KEY_3 0x00000020
71 #define HIDDI_KEY_4 0x00000021
72 #define HIDDI_KEY_5 0x00000022
73 #define HIDDI_KEY_6 0x00000023
74 #define HIDDI_KEY_7 0x00000024
75 #define HIDDI_KEY_8 0x00000025
76 #define HIDDI_KEY_9 0x00000026
77 #define HIDDI_KEY_0 0x00000027
78 #define HIDDI_KEY_MINUS 0x0000002D
79 #define HIDDI_KEY_EQUAL 0x0000002E
80 #define HIDDI_KEY_BACKSPACE 0x0000002A
81
82 #define HIDDI_KEY_TAB 0x0000002B
83 #define HIDDI_KEY_Q 0x00000014
84 #define HIDDI_KEY_W 0x0000001A
85 #define HIDDI_KEY_E 0x00000008
86 #define HIDDI_KEY_R 0x00000015
87 #define HIDDI_KEY_T 0x00000017
88 #define HIDDI_KEY_Y 0x0000001C
89 #define HIDDI_KEY_U 0x00000018
90 #define HIDDI_KEY_I 0x0000000C
91 #define HIDDI_KEY_O 0x00000012
92 #define HIDDI_KEY_P 0x00000013
93 #define HIDDI_KEY_LEFT_SQ_BRACKET 0x0000002F
94 #define HIDDI_KEY_RIGHT_SQ_BRACKET 0x00000030
95 #define HIDDI_KEY_BACKSLASH 0x00000031
96
97 #define HIDDI_KEY_CAPSLOCK 0x00000039
98 #define HIDDI_KEY_A 0x00000004
99 #define HIDDI_KEY_S 0x00000016
100 #define HIDDI_KEY_D 0x00000007
101 #define HIDDI_KEY_F 0x00000009
102 #define HIDDI_KEY_G 0x0000000A
103 #define HIDDI_KEY_H 0x0000000B
104 #define HIDDI_KEY_J 0x0000000D
105 #define HIDDI_KEY_K 0x0000000E
106 #define HIDDI_KEY_L 0x0000000F
107 #define HIDDI_KEY_SEMICOLON 0x00000033
108 #define HIDDI_KEY_QUOTE 0x00000034
109 #define HIDDI_KEY_ENTER 0x00000028
110
111 #define HIDDI_KEY_Z 0x0000001D
112 #define HIDDI_KEY_X 0x0000001B
113 #define HIDDI_KEY_C 0x00000006
114 #define HIDDI_KEY_V 0x00000019
115 #define HIDDI_KEY_B 0x00000005
116 #define HIDDI_KEY_N 0x00000011
117 #define HIDDI_KEY_M 0x00000010
118 #define HIDDI_KEY_COMMA 0x00000036
119 #define HIDDI_KEY_POINT 0x00000037
120 #define HIDDI_KEY_SLASH 0x00000038
121
122 #define HIDDI_KEY_SPACE 0x0000002C
123 #define HIDDI_KEY_MENU 0x00000065
124
125 #define HIDDI_KEY_PRINTSCREEN 0x00000046
126 #define HIDDI_KEY_SCROLLLOCK 0x00000047
127 #define HIDDI_KEY_PAUSE 0x00000048
128
129 #define HIDDI_KEY_INSERT 0x00000049
130 #define HIDDI_KEY_HOME 0x0000004A
131 #define HIDDI_KEY_PAGEUP 0x0000004B
132 #define HIDDI_KEY_DELETE 0x0000004C
133 #define HIDDI_KEY_END 0x0000004D
134 #define HIDDI_KEY_PAGEDOWN 0x0000004E
135
136 #define HIDDI_KEY_UP 0x00000052
137 #define HIDDI_KEY_LEFT 0x00000050
138 #define HIDDI_KEY_DOWN 0x00000051
139 #define HIDDI_KEY_RIGHT 0x0000004F
140
141 #define HIDDI_KEY_NUMLOCK 0x00000053
142 #define HIDDI_KEY_GR_SLASH 0x00000054
143 #define HIDDI_KEY_GR_ASTERISK 0x00000055
144 #define HIDDI_KEY_GR_MINUS 0x00000056
145 #define HIDDI_KEY_GR_7 0x0000005F
146 #define HIDDI_KEY_GR_8 0x00000060
147 #define HIDDI_KEY_GR_9 0x00000061
148 #define HIDDI_KEY_GR_PLUS 0x00000057
149 #define HIDDI_KEY_GR_4 0x0000005C
150 #define HIDDI_KEY_GR_5 0x0000005D
151 #define HIDDI_KEY_GR_6 0x0000005E
152 #define HIDDI_KEY_GR_1 0x00000059
153 #define HIDDI_KEY_GR_2 0x0000005A
154 #define HIDDI_KEY_GR_3 0x0000005B
155 #define HIDDI_KEY_GR_ENTER 0x00000058
156 #define HIDDI_KEY_GR_0 0x00000062
157 #define HIDDI_KEY_GR_DELETE 0x00000063
158
159 #endif /* __SDL_HIDDI_KEYBOARD_H__ */