blob: 749155ebab89af1d7c2222b0f530d593845060dd [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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 },
Dianne Hackborn935ae462009-04-13 16:11:55 -0700110 { "MEDIA_PLAY_PAUSE", 85 },
111 { "MEDIA_STOP", 86 },
112 { "MEDIA_NEXT", 87 },
113 { "MEDIA_PREVIOUS", 88 },
114 { "MEDIA_REWIND", 89 },
115 { "MEDIA_FAST_FORWARD", 90 },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800116 { "MUTE", 91 },
Chih-Wei Huang4fedd802009-05-27 15:52:50 +0800117 { "PAGE_UP", 92 },
118 { "PAGE_DOWN", 93 },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800119
120 // NOTE: If you add a new keycode here you must also add it to:
121 // (enum KeyCode, in this file)
122 // frameworks/base/core/java/android/view/KeyEvent.java
123 // tools/puppet_master/PuppetMaster.nav_keys.py
124 // frameworks/base/core/res/res/values/attrs.xml
125
126 { NULL, 0 }
127};
128
129// These constants need to match the above mappings.
130typedef enum KeyCode {
131 kKeyCodeUnknown = 0,
132
133 kKeyCodeSoftLeft = 1,
134 kKeyCodeSoftRight = 2,
135 kKeyCodeHome = 3,
136 kKeyCodeBack = 4,
137 kKeyCodeCall = 5,
138 kKeyCodeEndCall = 6,
139 kKeyCode0 = 7,
140 kKeyCode1 = 8,
141 kKeyCode2 = 9,
142 kKeyCode3 = 10,
143 kKeyCode4 = 11,
144 kKeyCode5 = 12,
145 kKeyCode6 = 13,
146 kKeyCode7 = 14,
147 kKeyCode8 = 15,
148 kKeyCode9 = 16,
149 kKeyCodeStar = 17,
150 kKeyCodePound = 18,
151 kKeyCodeDpadUp = 19,
152 kKeyCodeDpadDown = 20,
153 kKeyCodeDpadLeft = 21,
154 kKeyCodeDpadRight = 22,
155 kKeyCodeDpadCenter = 23,
156 kKeyCodeVolumeUp = 24,
157 kKeyCodeVolumeDown = 25,
158 kKeyCodePower = 26,
159 kKeyCodeCamera = 27,
160 kKeyCodeClear = 28,
161 kKeyCodeA = 29,
162 kKeyCodeB = 30,
163 kKeyCodeC = 31,
164 kKeyCodeD = 32,
165 kKeyCodeE = 33,
166 kKeyCodeF = 34,
167 kKeyCodeG = 35,
168 kKeyCodeH = 36,
169 kKeyCodeI = 37,
170 kKeyCodeJ = 38,
171 kKeyCodeK = 39,
172 kKeyCodeL = 40,
173 kKeyCodeM = 41,
174 kKeyCodeN = 42,
175 kKeyCodeO = 43,
176 kKeyCodeP = 44,
177 kKeyCodeQ = 45,
178 kKeyCodeR = 46,
179 kKeyCodeS = 47,
180 kKeyCodeT = 48,
181 kKeyCodeU = 49,
182 kKeyCodeV = 50,
183 kKeyCodeW = 51,
184 kKeyCodeX = 52,
185 kKeyCodeY = 53,
186 kKeyCodeZ = 54,
187 kKeyCodeComma = 55,
188 kKeyCodePeriod = 56,
189 kKeyCodeAltLeft = 57,
190 kKeyCodeAltRight = 58,
191 kKeyCodeShiftLeft = 59,
192 kKeyCodeShiftRight = 60,
193 kKeyCodeTab = 61,
194 kKeyCodeSpace = 62,
195 kKeyCodeSym = 63,
196 kKeyCodeExplorer = 64,
197 kKeyCodeEnvelope = 65,
198 kKeyCodeNewline = 66,
199 kKeyCodeDel = 67,
200 kKeyCodeGrave = 68,
201 kKeyCodeMinus = 69,
202 kKeyCodeEquals = 70,
203 kKeyCodeLeftBracket = 71,
204 kKeyCodeRightBracket = 72,
205 kKeyCodeBackslash = 73,
206 kKeyCodeSemicolon = 74,
207 kKeyCodeApostrophe = 75,
208 kKeyCodeSlash = 76,
209 kKeyCodeAt = 77,
210 kKeyCodeNum = 78,
211 kKeyCodeHeadSetHook = 79,
212 kKeyCodeFocus = 80,
213 kKeyCodePlus = 81,
214 kKeyCodeMenu = 82,
215 kKeyCodeNotification = 83,
216 kKeyCodeSearch = 84,
217 kKeyCodePlayPause = 85,
218 kKeyCodeStop = 86,
219 kKeyCodeNextSong = 87,
220 kKeyCodePreviousSong = 88,
221 kKeyCodeRewind = 89,
222 kKeyCodeForward = 90,
Chih-Wei Huang4fedd802009-05-27 15:52:50 +0800223 kKeyCodeMute = 91,
224 kKeyCodePageUp = 92,
225 kKeyCodePageDown = 93
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800226} KeyCode;
227
228static const KeycodeLabel FLAGS[] = {
229 { "WAKE", 0x00000001 },
230 { "WAKE_DROPPED", 0x00000002 },
231 { "SHIFT", 0x00000004 },
232 { "CAPS_LOCK", 0x00000008 },
233 { "ALT", 0x00000010 },
234 { "ALT_GR", 0x00000020 },
235 { "MENU", 0x00000040 },
236 { "LAUNCHER", 0x00000080 },
237 { NULL, 0 }
238};
239
240#endif // _UI_KEYCODE_LABELS_H