SDL
2.0
keyinfotable.h
Go to the documentation of this file.
1
/*
2
Simple DirectMedia Layer
3
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
4
5
This software is provided 'as-is', without any express or implied
6
warranty. In no event will the authors be held liable for any damages
7
arising from the use of this software.
8
9
Permission is granted to anyone to use this software for any purpose,
10
including commercial applications, and to alter it and redistribute it
11
freely, subject to the following restrictions:
12
13
1. The origin of this software must not be misrepresented; you must not
14
claim that you wrote the original software. If you use this software
15
in a product, an acknowledgment in the product documentation would be
16
appreciated but is not required.
17
2. Altered source versions must be plainly marked as such, and must not be
18
misrepresented as being the original software.
19
3. This notice may not be removed or altered from any source distribution.
20
*/
21
22
#ifndef _ANDROID_KeyInfo
23
#define _ANDROID_KeyInfo
24
25
#include "
SDL_scancode.h
"
26
#include "
SDL_keycode.h
"
27
28
/*
29
This file is used by the keyboard code in SDL_uikitview.m to convert between characters
30
passed in from the iPhone's virtual keyboard, and tuples of SDL_Scancode and SDL_keymods.
31
For example unicharToUIKeyInfoTable['a'] would give you the scan code and keymod for lower
32
case a.
33
*/
34
35
typedef
struct
36
{
37
SDL_Scancode
code
;
38
uint16_t
mod
;
39
}
AndroidKeyInfo
;
40
41
/* So far only ASCII characters here */
42
static
AndroidKeyInfo
unicharToAndroidKeyInfoTable
[] = {
43
/* 0 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
44
/* 1 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
45
/* 2 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
46
/* 3 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
47
/* 4 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
48
/* 5 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
49
/* 6 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
50
/* 7 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
51
/* 8 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
52
/* 9 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
53
/* 10 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
54
/* 11 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
55
/* 12 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
56
/* 13 */
{
SDL_SCANCODE_RETURN
, 0 },
57
/* 14 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
58
/* 15 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
59
/* 16 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
60
/* 17 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
61
/* 18 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
62
/* 19 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
63
/* 20 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
64
/* 21 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
65
/* 22 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
66
/* 23 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
67
/* 24 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
68
/* 25 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
69
/* 26 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
70
/* 27 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
71
/* 28 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
72
/* 29 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
73
/* 30 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
74
/* 31 */
{
SDL_SCANCODE_UNKNOWN
, 0 },
75
/* 32 */
{
SDL_SCANCODE_SPACE
, 0 },
76
/* 33 */
{
SDL_SCANCODE_1
,
KMOD_SHIFT
},
/* plus shift modifier '!' */
77
/* 34 */
{
SDL_SCANCODE_APOSTROPHE
, KMOD_SHIFT },
/* plus shift modifier '"' */
78
/* 35 */
{
SDL_SCANCODE_3
, KMOD_SHIFT },
/* plus shift modifier '#' */
79
/* 36 */
{
SDL_SCANCODE_4
, KMOD_SHIFT },
/* plus shift modifier '$' */
80
/* 37 */
{
SDL_SCANCODE_5
, KMOD_SHIFT },
/* plus shift modifier '%' */
81
/* 38 */
{
SDL_SCANCODE_7
, KMOD_SHIFT },
/* plus shift modifier '&' */
82
/* 39 */
{
SDL_SCANCODE_APOSTROPHE
, 0 },
/* ''' */
83
/* 40 */
{
SDL_SCANCODE_9
, KMOD_SHIFT },
/* plus shift modifier '(' */
84
/* 41 */
{
SDL_SCANCODE_0
, KMOD_SHIFT },
/* plus shift modifier ')' */
85
/* 42 */
{
SDL_SCANCODE_8
, KMOD_SHIFT },
/* '*' */
86
/* 43 */
{
SDL_SCANCODE_EQUALS
, KMOD_SHIFT },
/* plus shift modifier '+' */
87
/* 44 */
{
SDL_SCANCODE_COMMA
, 0 },
/* ',' */
88
/* 45 */
{
SDL_SCANCODE_MINUS
, 0 },
/* '-' */
89
/* 46 */
{
SDL_SCANCODE_PERIOD
, 0 },
/* '.' */
90
/* 47 */
{
SDL_SCANCODE_SLASH
, 0 },
/* '/' */
91
/* 48 */
{
SDL_SCANCODE_0
, 0 },
92
/* 49 */
{
SDL_SCANCODE_1
, 0 },
93
/* 50 */
{
SDL_SCANCODE_2
, 0 },
94
/* 51 */
{
SDL_SCANCODE_3
, 0 },
95
/* 52 */
{
SDL_SCANCODE_4
, 0 },
96
/* 53 */
{
SDL_SCANCODE_5
, 0 },
97
/* 54 */
{
SDL_SCANCODE_6
, 0 },
98
/* 55 */
{
SDL_SCANCODE_7
, 0 },
99
/* 56 */
{
SDL_SCANCODE_8
, 0 },
100
/* 57 */
{
SDL_SCANCODE_9
, 0 },
101
/* 58 */
{
SDL_SCANCODE_SEMICOLON
, KMOD_SHIFT },
/* plus shift modifier ';' */
102
/* 59 */
{
SDL_SCANCODE_SEMICOLON
, 0 },
103
/* 60 */
{
SDL_SCANCODE_COMMA
, KMOD_SHIFT },
/* plus shift modifier '<' */
104
/* 61 */
{
SDL_SCANCODE_EQUALS
, 0 },
105
/* 62 */
{
SDL_SCANCODE_PERIOD
, KMOD_SHIFT },
/* plus shift modifier '>' */
106
/* 63 */
{
SDL_SCANCODE_SLASH
, KMOD_SHIFT },
/* plus shift modifier '?' */
107
/* 64 */
{
SDL_SCANCODE_2
, KMOD_SHIFT },
/* plus shift modifier '@' */
108
/* 65 */
{
SDL_SCANCODE_A
, KMOD_SHIFT },
/* all the following need shift modifiers */
109
/* 66 */
{
SDL_SCANCODE_B
, KMOD_SHIFT },
110
/* 67 */
{
SDL_SCANCODE_C
, KMOD_SHIFT },
111
/* 68 */
{
SDL_SCANCODE_D
, KMOD_SHIFT },
112
/* 69 */
{
SDL_SCANCODE_E
, KMOD_SHIFT },
113
/* 70 */
{
SDL_SCANCODE_F
, KMOD_SHIFT },
114
/* 71 */
{
SDL_SCANCODE_G
, KMOD_SHIFT },
115
/* 72 */
{
SDL_SCANCODE_H
, KMOD_SHIFT },
116
/* 73 */
{
SDL_SCANCODE_I
, KMOD_SHIFT },
117
/* 74 */
{
SDL_SCANCODE_J
, KMOD_SHIFT },
118
/* 75 */
{
SDL_SCANCODE_K
, KMOD_SHIFT },
119
/* 76 */
{
SDL_SCANCODE_L
, KMOD_SHIFT },
120
/* 77 */
{
SDL_SCANCODE_M
, KMOD_SHIFT },
121
/* 78 */
{
SDL_SCANCODE_N
, KMOD_SHIFT },
122
/* 79 */
{
SDL_SCANCODE_O
, KMOD_SHIFT },
123
/* 80 */
{
SDL_SCANCODE_P
, KMOD_SHIFT },
124
/* 81 */
{
SDL_SCANCODE_Q
, KMOD_SHIFT },
125
/* 82 */
{
SDL_SCANCODE_R
, KMOD_SHIFT },
126
/* 83 */
{
SDL_SCANCODE_S
, KMOD_SHIFT },
127
/* 84 */
{
SDL_SCANCODE_T
, KMOD_SHIFT },
128
/* 85 */
{
SDL_SCANCODE_U
, KMOD_SHIFT },
129
/* 86 */
{
SDL_SCANCODE_V
, KMOD_SHIFT },
130
/* 87 */
{
SDL_SCANCODE_W
, KMOD_SHIFT },
131
/* 88 */
{
SDL_SCANCODE_X
, KMOD_SHIFT },
132
/* 89 */
{
SDL_SCANCODE_Y
, KMOD_SHIFT },
133
/* 90 */
{
SDL_SCANCODE_Z
, KMOD_SHIFT },
134
/* 91 */
{
SDL_SCANCODE_LEFTBRACKET
, 0 },
135
/* 92 */
{
SDL_SCANCODE_BACKSLASH
, 0 },
136
/* 93 */
{
SDL_SCANCODE_RIGHTBRACKET
, 0 },
137
/* 94 */
{
SDL_SCANCODE_6
, KMOD_SHIFT },
/* plus shift modifier '^' */
138
/* 95 */
{
SDL_SCANCODE_MINUS
, KMOD_SHIFT },
/* plus shift modifier '_' */
139
/* 96 */
{
SDL_SCANCODE_GRAVE
, KMOD_SHIFT },
/* '`' */
140
/* 97 */
{
SDL_SCANCODE_A
, 0 },
141
/* 98 */
{
SDL_SCANCODE_B
, 0 },
142
/* 99 */
{
SDL_SCANCODE_C
, 0 },
143
/* 100 */
{
SDL_SCANCODE_D
, 0 },
144
/* 101 */
{
SDL_SCANCODE_E
, 0 },
145
/* 102 */
{
SDL_SCANCODE_F
, 0 },
146
/* 103 */
{
SDL_SCANCODE_G
, 0 },
147
/* 104 */
{
SDL_SCANCODE_H
, 0 },
148
/* 105 */
{
SDL_SCANCODE_I
, 0 },
149
/* 106 */
{
SDL_SCANCODE_J
, 0 },
150
/* 107 */
{
SDL_SCANCODE_K
, 0 },
151
/* 108 */
{
SDL_SCANCODE_L
, 0 },
152
/* 109 */
{
SDL_SCANCODE_M
, 0 },
153
/* 110 */
{
SDL_SCANCODE_N
, 0 },
154
/* 111 */
{
SDL_SCANCODE_O
, 0 },
155
/* 112 */
{
SDL_SCANCODE_P
, 0 },
156
/* 113 */
{
SDL_SCANCODE_Q
, 0 },
157
/* 114 */
{
SDL_SCANCODE_R
, 0 },
158
/* 115 */
{
SDL_SCANCODE_S
, 0 },
159
/* 116 */
{
SDL_SCANCODE_T
, 0 },
160
/* 117 */
{
SDL_SCANCODE_U
, 0 },
161
/* 118 */
{
SDL_SCANCODE_V
, 0 },
162
/* 119 */
{
SDL_SCANCODE_W
, 0 },
163
/* 120 */
{
SDL_SCANCODE_X
, 0 },
164
/* 121 */
{
SDL_SCANCODE_Y
, 0 },
165
/* 122 */
{
SDL_SCANCODE_Z
, 0 },
166
/* 123 */
{
SDL_SCANCODE_LEFTBRACKET
, KMOD_SHIFT },
/* plus shift modifier '{' */
167
/* 124 */
{
SDL_SCANCODE_BACKSLASH
, KMOD_SHIFT },
/* plus shift modifier '|' */
168
/* 125 */
{
SDL_SCANCODE_RIGHTBRACKET
, KMOD_SHIFT },
/* plus shift modifier '}' */
169
/* 126 */
{
SDL_SCANCODE_GRAVE
, KMOD_SHIFT },
/* plus shift modifier '~' */
170
/* 127 */
{
SDL_SCANCODE_BACKSPACE
, KMOD_SHIFT }
171
};
172
173
#endif
/* _ANDROID_KeyInfo */
174
175
/* vi: set ts=4 sw=4 expandtab: */
SDL_SCANCODE_O
Definition:
SDL_scancode.h:68
SDL_SCANCODE_RETURN
Definition:
SDL_scancode.h:92
SDL_SCANCODE_K
Definition:
SDL_scancode.h:64
SDL_SCANCODE_5
Definition:
SDL_scancode.h:85
SDL_SCANCODE_3
Definition:
SDL_scancode.h:83
SDL_SCANCODE_BACKSLASH
Definition:
SDL_scancode.h:102
SDL_SCANCODE_SLASH
Definition:
SDL_scancode.h:149
SDL_SCANCODE_U
Definition:
SDL_scancode.h:74
SDL_SCANCODE_6
Definition:
SDL_scancode.h:86
SDL_SCANCODE_PERIOD
Definition:
SDL_scancode.h:148
uint16_t
unsigned short uint16_t
Definition:
SDL_config_windows.h:61
SDL_SCANCODE_N
Definition:
SDL_scancode.h:67
SDL_SCANCODE_4
Definition:
SDL_scancode.h:84
SDL_SCANCODE_EQUALS
Definition:
SDL_scancode.h:99
SDL_SCANCODE_SEMICOLON
Definition:
SDL_scancode.h:128
SDL_SCANCODE_7
Definition:
SDL_scancode.h:87
unicharToAndroidKeyInfoTable
static AndroidKeyInfo unicharToAndroidKeyInfoTable[]
Definition:
keyinfotable.h:42
AndroidKeyInfo
Definition:
keyinfotable.h:35
SDL_SCANCODE_Z
Definition:
SDL_scancode.h:79
SDL_SCANCODE_GRAVE
Definition:
SDL_scancode.h:130
SDL_SCANCODE_I
Definition:
SDL_scancode.h:62
SDL_SCANCODE_W
Definition:
SDL_scancode.h:76
SDL_SCANCODE_9
Definition:
SDL_scancode.h:89
SDL_SCANCODE_V
Definition:
SDL_scancode.h:75
SDL_SCANCODE_P
Definition:
SDL_scancode.h:69
SDL_SCANCODE_H
Definition:
SDL_scancode.h:61
SDL_SCANCODE_A
Definition:
SDL_scancode.h:54
SDL_SCANCODE_RIGHTBRACKET
Definition:
SDL_scancode.h:101
SDL_keycode.h
SDL_SCANCODE_SPACE
Definition:
SDL_scancode.h:96
SDL_SCANCODE_MINUS
Definition:
SDL_scancode.h:98
KMOD_SHIFT
#define KMOD_SHIFT
Definition:
SDL_keycode.h:343
SDL_SCANCODE_S
Definition:
SDL_scancode.h:72
SDL_SCANCODE_0
Definition:
SDL_scancode.h:90
SDL_SCANCODE_R
Definition:
SDL_scancode.h:71
SDL_SCANCODE_E
Definition:
SDL_scancode.h:58
SDL_SCANCODE_C
Definition:
SDL_scancode.h:56
SDL_SCANCODE_T
Definition:
SDL_scancode.h:73
SDL_scancode.h
SDL_SCANCODE_Y
Definition:
SDL_scancode.h:78
AndroidKeyInfo::code
SDL_Scancode code
Definition:
keyinfotable.h:37
SDL_SCANCODE_BACKSPACE
Definition:
SDL_scancode.h:94
SDL_SCANCODE_LEFTBRACKET
Definition:
SDL_scancode.h:100
SDL_SCANCODE_F
Definition:
SDL_scancode.h:59
SDL_SCANCODE_X
Definition:
SDL_scancode.h:77
SDL_SCANCODE_UNKNOWN
Definition:
SDL_scancode.h:45
SDL_SCANCODE_M
Definition:
SDL_scancode.h:66
SDL_SCANCODE_G
Definition:
SDL_scancode.h:60
SDL_SCANCODE_1
Definition:
SDL_scancode.h:81
SDL_SCANCODE_COMMA
Definition:
SDL_scancode.h:147
SDL_SCANCODE_B
Definition:
SDL_scancode.h:55
SDL_SCANCODE_J
Definition:
SDL_scancode.h:63
SDL_SCANCODE_2
Definition:
SDL_scancode.h:82
SDL_SCANCODE_L
Definition:
SDL_scancode.h:65
SDL_SCANCODE_APOSTROPHE
Definition:
SDL_scancode.h:129
SDL_SCANCODE_D
Definition:
SDL_scancode.h:57
SDL_SCANCODE_Q
Definition:
SDL_scancode.h:70
SDL_Scancode
SDL_Scancode
The SDL keyboard scancode representation.
Definition:
SDL_scancode.h:43
SDL_SCANCODE_8
Definition:
SDL_scancode.h:88
AndroidKeyInfo::mod
uint16_t mod
Definition:
keyinfotable.h:38
src
core
android
keyinfotable.h
Generated by
1.8.13