Mercurial > sdl-ios-xcode
comparison src/video/uikit/keyinfotable.h @ 2407:6c31bbd56c49 gsoc2008_iphone
keyinfotable.h contains information which SDL_uikitkeyboard uses to convert between unichar characters that it reads from the text field (which acts as the keyboard's target) to SDL_scancodes and key modifiers which are sent to SDL's keyboard system.
author | Holmes Futrell <hfutrell@umail.ucsb.edu> |
---|---|
date | Tue, 29 Jul 2008 17:23:50 +0000 |
parents | |
children | 7683a2e0e5e9 |
comparison
equal
deleted
inserted
replaced
2406:05e8f46403c0 | 2407:6c31bbd56c49 |
---|---|
1 /* | |
2 * scancodes_iphoneos.h | |
3 * SDLiPhoneOS | |
4 * | |
5 * Created by Holmes Futrell on 7/25/08. | |
6 * Copyright 2008 __MyCompanyName__. All rights reserved. | |
7 * | |
8 */ | |
9 | |
10 #ifndef _UIKIT_KeyInfo | |
11 #define _UIKIT_KeyInfo | |
12 | |
13 #include "SDL_scancode.h" | |
14 | |
15 typedef struct { | |
16 SDL_scancode code; | |
17 Uint16 mod; | |
18 } UIKitKeyInfo; | |
19 | |
20 /* So far only ASCII characters here */ | |
21 static UIKitKeyInfo unicharToUIKeyInfoTable[] = { | |
22 | |
23 /* 0 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
24 /* 1 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
25 /* 2 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
26 /* 3 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
27 /* 4 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
28 /* 5 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
29 /* 6 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
30 /* 7 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
31 /* 8 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
32 /* 9 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
33 /* 10 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
34 /* 11 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
35 /* 12 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
36 /* 13 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
37 /* 14 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
38 /* 15 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
39 /* 16 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
40 /* 17 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
41 /* 18 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
42 /* 19 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
43 /* 20 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
44 /* 21 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
45 /* 22 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
46 /* 23 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
47 /* 24 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
48 /* 25 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
49 /* 26 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
50 /* 27 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
51 /* 28 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
52 /* 29 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
53 /* 30 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
54 /* 31 */ { SDL_SCANCODE_UNKNOWN, 0 }, | |
55 /* 32 */ { SDL_SCANCODE_SPACE, 0 }, | |
56 /* 33 */ { SDL_SCANCODE_1, KMOD_SHIFT }, /* plus shift modifier '!' */ | |
57 /* 34 */ { SDL_SCANCODE_APOSTROPHE, KMOD_SHIFT }, /* plus shift modifier '"' */ | |
58 /* 35 */ { SDL_SCANCODE_3, KMOD_SHIFT }, /* plus shift modifier '#' */ | |
59 /* 36 */ { SDL_SCANCODE_4, KMOD_SHIFT }, /* plus shift modifier '$' */ | |
60 /* 37 */ { SDL_SCANCODE_5, KMOD_SHIFT }, /* plus shift modifier '%' */ | |
61 /* 38 */ { SDL_SCANCODE_7, KMOD_SHIFT }, /* plus shift modifier '&' */ | |
62 /* 39 */ { SDL_SCANCODE_APOSTROPHE, 0 }, /* ''' */ | |
63 /* 40 */ { SDL_SCANCODE_9, KMOD_SHIFT }, /* plus shift modifier '(' */ | |
64 /* 41 */ { SDL_SCANCODE_0, KMOD_SHIFT }, /* plus shift modifier ')' */ | |
65 /* 42 */ { SDL_SCANCODE_8, KMOD_SHIFT }, /* '*' */ | |
66 /* 43 */ { SDL_SCANCODE_EQUALS, KMOD_SHIFT }, /* plus shift modifier '+' */ | |
67 /* 44 */ { SDL_SCANCODE_COMMA, 0 }, /* ',' */ | |
68 /* 45 */ { SDL_SCANCODE_MINUS, 0 }, /* '-' */ | |
69 /* 46 */ { SDL_SCANCODE_PERIOD, 0 }, /* '.' */ | |
70 /* 47 */ { SDL_SCANCODE_SLASH, 0 }, /* '/' */ | |
71 /* 48 */ { SDL_SCANCODE_0, 0 }, | |
72 /* 49 */ { SDL_SCANCODE_1, 0 }, | |
73 /* 50 */ { SDL_SCANCODE_2, 0 }, | |
74 /* 51 */ { SDL_SCANCODE_3, 0 }, | |
75 /* 52 */ { SDL_SCANCODE_4, 0 }, | |
76 /* 53 */ { SDL_SCANCODE_5, 0 }, | |
77 /* 54 */ { SDL_SCANCODE_6, 0 }, | |
78 /* 55 */ { SDL_SCANCODE_7, 0 }, | |
79 /* 56 */ { SDL_SCANCODE_8, 0 }, | |
80 /* 57 */ { SDL_SCANCODE_9, 0 }, | |
81 /* 58 */ { SDL_SCANCODE_SEMICOLON, KMOD_SHIFT }, /* plus shift modifier ';' */ | |
82 /* 59 */ { SDL_SCANCODE_SEMICOLON, 0 }, | |
83 /* 60 */ { SDL_SCANCODE_COMMA, KMOD_SHIFT }, /* plus shift modifier '<' */ | |
84 /* 61 */ { SDL_SCANCODE_EQUALS, 0 }, | |
85 /* 62 */ { SDL_SCANCODE_PERIOD, KMOD_SHIFT }, /* plus shift modifier '>' */ | |
86 /* 63 */ { SDL_SCANCODE_SLASH, KMOD_SHIFT }, /* plus shift modifier '?' */ | |
87 /* 64 */ { SDL_SCANCODE_2, KMOD_SHIFT }, /* plus shift modifier '@' */ | |
88 /* 65 */ { SDL_SCANCODE_A, KMOD_SHIFT }, /* all the following need shift modifiers */ | |
89 /* 66 */ { SDL_SCANCODE_B, KMOD_SHIFT }, | |
90 /* 67 */ { SDL_SCANCODE_C, KMOD_SHIFT }, | |
91 /* 68 */ { SDL_SCANCODE_D, KMOD_SHIFT }, | |
92 /* 69 */ { SDL_SCANCODE_E, KMOD_SHIFT }, | |
93 /* 70 */ { SDL_SCANCODE_F, KMOD_SHIFT }, | |
94 /* 71 */ { SDL_SCANCODE_G, KMOD_SHIFT }, | |
95 /* 72 */ { SDL_SCANCODE_H, KMOD_SHIFT }, | |
96 /* 73 */ { SDL_SCANCODE_I, KMOD_SHIFT }, | |
97 /* 74 */ { SDL_SCANCODE_J, KMOD_SHIFT }, | |
98 /* 75 */ { SDL_SCANCODE_K, KMOD_SHIFT }, | |
99 /* 76 */ { SDL_SCANCODE_L, KMOD_SHIFT }, | |
100 /* 77 */ { SDL_SCANCODE_M, KMOD_SHIFT }, | |
101 /* 78 */ { SDL_SCANCODE_N, KMOD_SHIFT }, | |
102 /* 79 */ { SDL_SCANCODE_O, KMOD_SHIFT }, | |
103 /* 80 */ { SDL_SCANCODE_P, KMOD_SHIFT }, | |
104 /* 81 */ { SDL_SCANCODE_Q, KMOD_SHIFT }, | |
105 /* 82 */ { SDL_SCANCODE_R, KMOD_SHIFT }, | |
106 /* 83 */ { SDL_SCANCODE_S, KMOD_SHIFT }, | |
107 /* 84 */ { SDL_SCANCODE_T, KMOD_SHIFT }, | |
108 /* 85 */ { SDL_SCANCODE_U, KMOD_SHIFT }, | |
109 /* 86 */ { SDL_SCANCODE_V, KMOD_SHIFT }, | |
110 /* 87 */ { SDL_SCANCODE_W, KMOD_SHIFT }, | |
111 /* 88 */ { SDL_SCANCODE_X, KMOD_SHIFT }, | |
112 /* 89 */ { SDL_SCANCODE_Y, KMOD_SHIFT }, | |
113 /* 90 */ { SDL_SCANCODE_Z, KMOD_SHIFT }, | |
114 /* 91 */ { SDL_SCANCODE_LEFTBRACKET, 0 }, | |
115 /* 92 */ { SDL_SCANCODE_BACKSLASH, 0 }, | |
116 /* 93 */ { SDL_SCANCODE_RIGHTBRACKET, 0 }, | |
117 /* 94 */ { SDL_SCANCODE_6, KMOD_SHIFT }, /* plus shift modifier '^' */ | |
118 /* 95 */ { SDL_SCANCODE_MINUS, KMOD_SHIFT }, /* plus shift modifier '_' */ | |
119 /* 96 */ { SDL_SCANCODE_GRAVE, KMOD_SHIFT }, /* '`' | |
120 /* 97 */ { SDL_SCANCODE_A, 0 }, | |
121 /* 98 */ { SDL_SCANCODE_B, 0 }, | |
122 /* 99 */ { SDL_SCANCODE_C, 0 }, | |
123 /* 100 */{ SDL_SCANCODE_D, 0 }, | |
124 /* 101 */{ SDL_SCANCODE_E, 0 }, | |
125 /* 102 */{ SDL_SCANCODE_F, 0 }, | |
126 /* 103 */{ SDL_SCANCODE_G, 0 }, | |
127 /* 104 */{ SDL_SCANCODE_H, 0 }, | |
128 /* 105 */{ SDL_SCANCODE_I, 0 }, | |
129 /* 106 */{ SDL_SCANCODE_J, 0 }, | |
130 /* 107 */{ SDL_SCANCODE_K, 0 }, | |
131 /* 108 */{ SDL_SCANCODE_L, 0 }, | |
132 /* 109 */{ SDL_SCANCODE_M, 0 }, | |
133 /* 110 */{ SDL_SCANCODE_N, 0 }, | |
134 /* 111 */{ SDL_SCANCODE_O, 0 }, | |
135 /* 112 */{ SDL_SCANCODE_P, 0 }, | |
136 /* 113 */{ SDL_SCANCODE_Q, 0 }, | |
137 /* 114 */{ SDL_SCANCODE_R, 0 }, | |
138 /* 115 */{ SDL_SCANCODE_S, 0 }, | |
139 /* 116 */{ SDL_SCANCODE_T, 0 }, | |
140 /* 117 */{ SDL_SCANCODE_U, 0 }, | |
141 /* 118 */{ SDL_SCANCODE_V, 0 }, | |
142 /* 119 */{ SDL_SCANCODE_W, 0 }, | |
143 /* 120 */{ SDL_SCANCODE_X, 0 }, | |
144 /* 121 */{ SDL_SCANCODE_Y, 0 }, | |
145 /* 122 */{ SDL_SCANCODE_Z, 0 }, | |
146 /* 123 */{ SDL_SCANCODE_LEFTBRACKET, KMOD_SHIFT }, /* plus shift modifier '{' */ | |
147 /* 124 */{ SDL_SCANCODE_BACKSLASH, KMOD_SHIFT }, /* plus shift modifier '|' */ | |
148 /* 125 */{ SDL_SCANCODE_RIGHTBRACKET, KMOD_SHIFT }, /* plus shift modifier '}' */ | |
149 /* 126 */{ SDL_SCANCODE_GRAVE, KMOD_SHIFT }, /* plus shift modifier '~' */ | |
150 /* 127 */{ SDL_SCANCODE_DELETE, KMOD_SHIFT } | |
151 }; | |
152 | |
153 #endif /* UIKitKeyInfo */ |