blob: 53c118872814bc0d57c64064422f34f968f0745b [file] [log] [blame]
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -07001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _UI_KEYCODE_LABELS_H
18#define _UI_KEYCODE_LABELS_H
19
20struct KeycodeLabel {
21 const char *literal;
22 int value;
23};
24
25static const KeycodeLabel KEYCODES[] = {
26 { "SOFT_LEFT", 1 },
27 { "SOFT_RIGHT", 2 },
28 { "HOME", 3 },
29 { "BACK", 4 },
30 { "CALL", 5 },
31 { "ENDCALL", 6 },
32 { "0", 7 },
33 { "1", 8 },
34 { "2", 9 },
35 { "3", 10 },
36 { "4", 11 },
37 { "5", 12 },
38 { "6", 13 },
39 { "7", 14 },
40 { "8", 15 },
41 { "9", 16 },
42 { "STAR", 17 },
43 { "POUND", 18 },
44 { "DPAD_UP", 19 },
45 { "DPAD_DOWN", 20 },
46 { "DPAD_LEFT", 21 },
47 { "DPAD_RIGHT", 22 },
48 { "DPAD_CENTER", 23 },
49 { "VOLUME_UP", 24 },
50 { "VOLUME_DOWN", 25 },
51 { "POWER", 26 },
52 { "CAMERA", 27 },
53 { "CLEAR", 28 },
54 { "A", 29 },
55 { "B", 30 },
56 { "C", 31 },
57 { "D", 32 },
58 { "E", 33 },
59 { "F", 34 },
60 { "G", 35 },
61 { "H", 36 },
62 { "I", 37 },
63 { "J", 38 },
64 { "K", 39 },
65 { "L", 40 },
66 { "M", 41 },
67 { "N", 42 },
68 { "O", 43 },
69 { "P", 44 },
70 { "Q", 45 },
71 { "R", 46 },
72 { "S", 47 },
73 { "T", 48 },
74 { "U", 49 },
75 { "V", 50 },
76 { "W", 51 },
77 { "X", 52 },
78 { "Y", 53 },
79 { "Z", 54 },
80 { "COMMA", 55 },
81 { "PERIOD", 56 },
82 { "ALT_LEFT", 57 },
83 { "ALT_RIGHT", 58 },
84 { "SHIFT_LEFT", 59 },
85 { "SHIFT_RIGHT", 60 },
86 { "TAB", 61 },
87 { "SPACE", 62 },
88 { "SYM", 63 },
89 { "EXPLORER", 64 },
90 { "ENVELOPE", 65 },
91 { "ENTER", 66 },
92 { "DEL", 67 },
93 { "GRAVE", 68 },
94 { "MINUS", 69 },
95 { "EQUALS", 70 },
96 { "LEFT_BRACKET", 71 },
97 { "RIGHT_BRACKET", 72 },
98 { "BACKSLASH", 73 },
99 { "SEMICOLON", 74 },
100 { "APOSTROPHE", 75 },
101 { "SLASH", 76 },
102 { "AT", 77 },
103 { "NUM", 78 },
104 { "HEADSETHOOK", 79 },
105 { "FOCUS", 80 },
106 { "PLUS", 81 },
107 { "MENU", 82 },
108 { "NOTIFICATION", 83 },
109 { "SEARCH", 84 },
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -0800110 { "PLAYPAUSE", 85 },
111 { "STOP", 86 },
112 { "NEXTSONG", 87 },
113 { "PREVIOUSSONG", 88 },
114 { "REWIND", 89 },
115 { "FORWARD", 90 },
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -0700116
117 // NOTE: If you add a new keycode here you must also add it to:
118 // (enum KeyCode, in this file)
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -0800119 // frameworks/base/core/java/android/view/KeyEvent.java
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -0700120 // tools/puppet_master/PuppetMaster.nav_keys.py
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -0800121 // frameworks/base/core/res/res/values/attrs.xml
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -0700122
123 { NULL, 0 }
124};
125
126// These constants need to match the above mappings.
127typedef enum KeyCode {
128 kKeyCodeUnknown = 0,
129
130 kKeyCodeSoftLeft = 1,
131 kKeyCodeSoftRight = 2,
132 kKeyCodeHome = 3,
133 kKeyCodeBack = 4,
134 kKeyCodeCall = 5,
135 kKeyCodeEndCall = 6,
136 kKeyCode0 = 7,
137 kKeyCode1 = 8,
138 kKeyCode2 = 9,
139 kKeyCode3 = 10,
140 kKeyCode4 = 11,
141 kKeyCode5 = 12,
142 kKeyCode6 = 13,
143 kKeyCode7 = 14,
144 kKeyCode8 = 15,
145 kKeyCode9 = 16,
146 kKeyCodeStar = 17,
147 kKeyCodePound = 18,
148 kKeyCodeDpadUp = 19,
149 kKeyCodeDpadDown = 20,
150 kKeyCodeDpadLeft = 21,
151 kKeyCodeDpadRight = 22,
152 kKeyCodeDpadCenter = 23,
153 kKeyCodeVolumeUp = 24,
154 kKeyCodeVolumeDown = 25,
155 kKeyCodePower = 26,
156 kKeyCodeCamera = 27,
157 kKeyCodeClear = 28,
158 kKeyCodeA = 29,
159 kKeyCodeB = 30,
160 kKeyCodeC = 31,
161 kKeyCodeD = 32,
162 kKeyCodeE = 33,
163 kKeyCodeF = 34,
164 kKeyCodeG = 35,
165 kKeyCodeH = 36,
166 kKeyCodeI = 37,
167 kKeyCodeJ = 38,
168 kKeyCodeK = 39,
169 kKeyCodeL = 40,
170 kKeyCodeM = 41,
171 kKeyCodeN = 42,
172 kKeyCodeO = 43,
173 kKeyCodeP = 44,
174 kKeyCodeQ = 45,
175 kKeyCodeR = 46,
176 kKeyCodeS = 47,
177 kKeyCodeT = 48,
178 kKeyCodeU = 49,
179 kKeyCodeV = 50,
180 kKeyCodeW = 51,
181 kKeyCodeX = 52,
182 kKeyCodeY = 53,
183 kKeyCodeZ = 54,
184 kKeyCodeComma = 55,
185 kKeyCodePeriod = 56,
186 kKeyCodeAltLeft = 57,
187 kKeyCodeAltRight = 58,
188 kKeyCodeShiftLeft = 59,
189 kKeyCodeShiftRight = 60,
190 kKeyCodeTab = 61,
191 kKeyCodeSpace = 62,
192 kKeyCodeSym = 63,
193 kKeyCodeExplorer = 64,
194 kKeyCodeEnvelope = 65,
195 kKeyCodeNewline = 66,
196 kKeyCodeDel = 67,
197 kKeyCodeGrave = 68,
198 kKeyCodeMinus = 69,
199 kKeyCodeEquals = 70,
200 kKeyCodeLeftBracket = 71,
201 kKeyCodeRightBracket = 72,
202 kKeyCodeBackslash = 73,
203 kKeyCodeSemicolon = 74,
204 kKeyCodeApostrophe = 75,
205 kKeyCodeSlash = 76,
206 kKeyCodeAt = 77,
207 kKeyCodeNum = 78,
208 kKeyCodeHeadSetHook = 79,
209 kKeyCodeFocus = 80,
210 kKeyCodePlus = 81,
211 kKeyCodeMenu = 82,
212 kKeyCodeNotification = 83,
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -0800213 kKeyCodeSearch = 84,
214 kKeyCodePlayPause = 85,
215 kKeyCodeStop = 86,
216 kKeyCodeNextSong = 87,
217 kKeyCodePreviousSong = 88,
218 kKeyCodeRewind = 89,
219 kKeyCodeForward = 90
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -0700220} KeyCode;
221
222static const KeycodeLabel FLAGS[] = {
223 { "WAKE", 0x00000001 },
224 { "WAKE_DROPPED", 0x00000002 },
225 { "SHIFT", 0x00000004 },
226 { "CAPS_LOCK", 0x00000008 },
227 { "ALT", 0x00000010 },
228 { "ALT_GR", 0x00000020 },
229 { "MENU", 0x00000040 },
230 { "LAUNCHER", 0x00000080 },
231 { NULL, 0 }
232};
233
234#endif // _UI_KEYCODE_LABELS_H