2
* Copyright (C) 2010 The Android Open Source Project
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
8
* http://www.apache.org/licenses/LICENSE-2.0
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.
17
// Note: This translation does not limit itself to the NDK defined constants
18
// but instead all constants from android.view.KeyEvent can be added here
20
// The NDK files are located in usr/include/android/keycodes.h
27
(******************************************************************
31
* This file is part of Android's set of stable system headers
32
* exposed by the Android NDK (Native Development Kit).
34
* Third-party source AND binary code relies on the definitions
35
* here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES.
37
* - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES)
38
* - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS
39
* - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY
40
* - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES
48
// First NDK defined keycodes
51
AKEYCODE_SOFT_LEFT = 1;
52
AKEYCODE_SOFT_RIGHT = 2;
69
AKEYCODE_DPAD_UP = 19;
70
AKEYCODE_DPAD_DOWN = 20;
71
AKEYCODE_DPAD_LEFT = 21;
72
AKEYCODE_DPAD_RIGHT = 22;
73
AKEYCODE_DPAD_CENTER = 23;
74
AKEYCODE_VOLUME_UP = 24;
75
AKEYCODE_VOLUME_DOWN = 25;
106
AKEYCODE_PERIOD = 56;
107
AKEYCODE_ALT_LEFT = 57;
108
AKEYCODE_ALT_RIGHT = 58;
109
AKEYCODE_SHIFT_LEFT = 59;
110
AKEYCODE_SHIFT_RIGHT = 60;
114
AKEYCODE_EXPLORER = 64;
115
AKEYCODE_ENVELOPE = 65;
120
AKEYCODE_EQUALS = 70;
121
AKEYCODE_LEFT_BRACKET = 71;
122
AKEYCODE_RIGHT_BRACKET = 72;
123
AKEYCODE_BACKSLASH = 73;
124
AKEYCODE_SEMICOLON = 74;
125
AKEYCODE_APOSTROPHE = 75;
129
AKEYCODE_HEADSETHOOK = 79;
130
AKEYCODE_FOCUS = 80; // *Camera* focus
133
AKEYCODE_NOTIFICATION = 83;
134
AKEYCODE_SEARCH = 84;
135
AKEYCODE_MEDIA_PLAY_PAUSE = 85;
136
AKEYCODE_MEDIA_STOP = 86;
137
AKEYCODE_MEDIA_NEXT = 87;
138
AKEYCODE_MEDIA_PREVIOUS = 88;
139
AKEYCODE_MEDIA_REWIND = 89;
140
AKEYCODE_MEDIA_FAST_FORWARD = 90;
142
AKEYCODE_PAGE_UP = 92;
143
AKEYCODE_PAGE_DOWN = 93;
144
AKEYCODE_PICTSYMBOLS = 94;
145
AKEYCODE_SWITCH_CHARSET = 95;
146
AKEYCODE_BUTTON_A = 96;
147
AKEYCODE_BUTTON_B = 97;
148
AKEYCODE_BUTTON_C = 98;
149
AKEYCODE_BUTTON_X = 99;
150
AKEYCODE_BUTTON_Y = 100;
151
AKEYCODE_BUTTON_Z = 101;
152
AKEYCODE_BUTTON_L1 = 102;
153
AKEYCODE_BUTTON_R1 = 103;
154
AKEYCODE_BUTTON_L2 = 104;
155
AKEYCODE_BUTTON_R2 = 105;
156
AKEYCODE_BUTTON_THUMBL = 106;
157
AKEYCODE_BUTTON_THUMBR = 107;
158
AKEYCODE_BUTTON_START = 108;
159
AKEYCODE_BUTTON_SELECT = 109;
160
AKEYCODE_BUTTON_MODE = 110;
162
// Now all elements from android.view.KeyEvent
168
FLAG_CANCELED_LONG_PRESS = $100;
169
FLAG_EDITOR_ACTION = $10;
170
FLAG_FALLBACK = $400;
171
FLAG_FROM_SYSTEM = 8;
172
FLAG_KEEP_TOUCH_MODE = 4;
173
FLAG_LONG_PRESS = $80;
174
FLAG_SOFT_KEYBOARD = 2;
175
FLAG_TRACKING = $200;
176
FLAG_VIRTUAL_HARD_KEY = $40;
182
KEYCODE_3D_MODE = $000000ce; // 3D Mode key. Toggles the display between 2D and 3D mode.
190
KEYCODE_ALT_LEFT = $00000039;
191
KEYCODE_ALT_RIGHT = $0000003a;
192
KEYCODE_APOSTROPHE = $0000004b;
193
KEYCODE_APP_SWITCH = $000000bb;
194
KEYCODE_AT = $0000004d;
195
KEYCODE_AVR_INPUT = $000000b6;
196
KEYCODE_AVR_POWER = $000000b5;
199
KEYCODE_BACKSLASH = $00000049;
200
KEYCODE_BOOKMARK = $000000ae;
201
KEYCODE_BREAK = $00000079;
202
KEYCODE_BUTTON_1 = $000000bc;
203
KEYCODE_BUTTON_10 = $000000c5;
204
KEYCODE_BUTTON_11 = $000000c6;
205
KEYCODE_BUTTON_12 = $000000c7;
206
KEYCODE_BUTTON_13 = $000000c8;
207
KEYCODE_BUTTON_14 = $000000c9;
208
KEYCODE_BUTTON_15 = $000000ca;
209
KEYCODE_BUTTON_16 = $000000cb; // Generic Game Pad Button #16.
210
KEYCODE_BUTTON_2 = $000000bd; // Generic Game Pad Button #2.
211
KEYCODE_BUTTON_3 = $000000be;
212
KEYCODE_BUTTON_4 = $000000bf;
213
KEYCODE_BUTTON_5 = $000000c0;
214
KEYCODE_BUTTON_6 = $000000c1;
215
KEYCODE_BUTTON_7 = $000000c2;
216
KEYCODE_BUTTON_8 = $000000c3;
217
KEYCODE_BUTTON_9 = $000000c4; // Generic Game Pad Button #9.
218
KEYCODE_BUTTON_A = $00000060; // A Button key. On a game controller, the A button should be either the button labeled A or the first button on the upper row of controller buttons.
219
KEYCODE_BUTTON_B = $00000061;
220
KEYCODE_BUTTON_C = $00000062;
221
KEYCODE_BUTTON_L1 = $00000066; // L1 Button key. On a game controller, the L1 button should be either the button labeled L1 (or L) or the top left trigger button.
222
KEYCODE_BUTTON_L2 = $00000068;
223
KEYCODE_BUTTON_MODE = $0000006e; // Mode Button key. On a game controller, the button labeled Mode.
224
KEYCODE_BUTTON_R1 = $00000067; // R1 Button key. On a game controller, the R1 button should be either the button labeled R1 (or R) or the top right trigger button.
225
KEYCODE_BUTTON_R2 = $00000069; // R2 Button key. On a game controller, the R2 button should be either the button labeled R2 or the bottom right trigger button.
226
KEYCODE_BUTTON_SELECT = $0000006d; // Select Button key. On a game controller, the button labeled Select.
227
KEYCODE_BUTTON_START = $0000006c; // Start Button key. On a game controller, the button labeled Start.
228
KEYCODE_BUTTON_THUMBL = $0000006a; // Left Thumb Button key. On a game controller, the left thumb button indicates that the left (or only) joystick is pressed.
229
KEYCODE_BUTTON_THUMBR = $0000006b; // Right Thumb Button key. On a game controller, the right thumb button indicates that the right joystick is pressed.
230
KEYCODE_BUTTON_X = $00000063; // X Button key. On a game controller, the X button should be either the button labeled X or the first button on the lower row of controller buttons.
231
KEYCODE_BUTTON_Y = $00000064; // Y Button key. On a game controller, the Y button should be either the button labeled Y or the second button on the lower row of controller buttons.
232
KEYCODE_BUTTON_Z = $00000065; // Z Button key. On a game controller, the Z button should be either the button labeled Z or the third button on the lower row of controller buttons.
233
KEYCODE_C = 31; // 'C' key.
234
KEYCODE_CALCULATOR = $000000d2; // Calculator special function key. Used to launch a calculator application.
235
KEYCODE_CALENDAR = $000000d0; // Calendar special function key. Used to launch a calendar application.
236
KEYCODE_CALL = $00000005; // Call key.
237
KEYCODE_CAMERA = $0000001b; // Camera key. Used to launch a camera application or take pictures.
238
KEYCODE_CAPS_LOCK = $00000073;
239
KEYCODE_CAPTIONS = $000000af; // Toggle captions key. Switches the mode for closed-captioning text, for example during television shows.
240
KEYCODE_CHANNEL_DOWN = $000000a7; // Channel down key. On TV remotes, decrements the television channel.
241
KEYCODE_CHANNEL_UP = $000000a6; // Channel up key. On TV remotes, increments the television channel.
242
KEYCODE_CLEAR = $0000001c;
243
KEYCODE_COMMA = $00000037;
244
KEYCODE_CONTACTS = $000000cf; // Contacts special function key. Used to launch an address book application.
245
KEYCODE_CTRL_LEFT = $00000071; // Left Control modifier key.
246
KEYCODE_CTRL_RIGHT = $00000072; // Right Control modifier key.
248
KEYCODE_DEL = $00000043; // Backspace key. Deletes characters before the insertion point, unlike KEYCODE_FORWARD_DEL.
249
KEYCODE_DPAD_CENTER = $00000017; // Directional Pad Center key. May also be synthesized from trackball motions.
250
KEYCODE_DPAD_DOWN = $00000014; // Directional Pad Down key. May also be synthesized from trackball motions.
251
KEYCODE_DPAD_LEFT = $00000015; // Directional Pad Left key. May also be synthesized from trackball motions.
252
KEYCODE_DPAD_RIGHT = $00000016; // Directional Pad Right key. May also be synthesized from trackball motions.
253
KEYCODE_DPAD_UP = $00000013; // Directional Pad Up key. May also be synthesized from trackball motions.
254
KEYCODE_DVR = $000000ad; // DVR key. On some TV remotes, switches to a DVR mode for recorded shows.
256
KEYCODE_ENDCALL = $00000006; // End Call key.
257
KEYCODE_ENTER = $00000042; // Enter key.
258
KEYCODE_ENVELOPE = $00000041; // Envelope special function key. Used to launch a mail application.
259
KEYCODE_EQUALS = $00000046; // '=' key.
260
KEYCODE_ESCAPE = $0000006f; // Escape key.
261
KEYCODE_EXPLORER = $00000040; // Explorer special function key. Used to launch a browser application.
262
KEYCODE_F = 34; // 'F' key.
263
KEYCODE_F1 = $00000083;
264
KEYCODE_F10 = $0000008c;
265
KEYCODE_F11 = $0000008d;
266
KEYCODE_F12 = $0000008e;
267
KEYCODE_F2 = $00000084;
268
KEYCODE_F3 = $00000085;
269
KEYCODE_F4 = $00000086;
270
KEYCODE_F5 = $00000087;
271
KEYCODE_F6 = $00000088;
272
KEYCODE_F7 = $00000089;
273
KEYCODE_F8 = $0000008a;
274
KEYCODE_F9 = $0000008b;
275
KEYCODE_FOCUS = $00000050; // Camera Focus key. Used to focus the camera.
276
KEYCODE_FORWARD = $0000007d; // Forward key. Navigates forward in the history stack. Complement of KEYCODE_BACK.
277
KEYCODE_FORWARD_DEL = $00000070; // Forward Delete key. Deletes characters ahead of the insertion point, unlike KEYCODE_DEL.
278
KEYCODE_FUNCTION = $00000077; // Function modifier key.
280
KEYCODE_GRAVE = $00000044; // '`' (backtick) key.
281
KEYCODE_GUIDE = $000000ac; // Guide key. On TV remotes, shows a programming guide.
283
KEYCODE_HEADSETHOOK = $0000004f; // Headset Hook key. Used to hang up calls and stop media.
284
KEYCODE_HOME = $00000003; // Home key. This key is handled by the framework and is never delivered to applications.
286
KEYCODE_INFO = $000000a5; // Info key. Common on TV remotes to show additional information related to what is currently being viewed.
287
KEYCODE_INSERT = $0000007c; // Insert key. Toggles insert / overwrite edit mode.
291
KEYCODE_LANGUAGE_SWITCH = $000000cc; // Language Switch key. Toggles the current input language such as switching between English and Japanese on a QWERTY keyboard. On some devices, the same function may be performed by pressing Shift+Spacebar.
292
KEYCODE_LEFT_BRACKET = $00000047; // '[' key.
294
KEYCODE_MANNER_MODE = $000000cd; // Manner Mode key. Toggles silent or vibrate mode on and off to make the device behave more politely in certain settings such as on a crowded train. On some devices, the key may only operate when long-pressed.
295
KEYCODE_MEDIA_CLOSE = $00000080; // Close media key. May be used to close a CD tray, for example.
296
KEYCODE_MEDIA_EJECT = $00000081; // Eject media key. May be used to eject a CD tray, for example.
297
KEYCODE_MEDIA_FAST_FORWARD = $0000005a; // Fast Forward media key.
298
KEYCODE_MEDIA_NEXT = $00000057; // Play Next media key.
299
KEYCODE_MEDIA_PAUSE = $0000007f; // Pause media key.
300
KEYCODE_MEDIA_PLAY = $0000007e; // Play media key.
301
KEYCODE_MEDIA_PLAY_PAUSE = $00000055; // Play/Pause media key.
302
KEYCODE_MEDIA_PREVIOUS = $00000058; // Play Previous media key.
303
KEYCODE_MEDIA_RECORD = $00000082; // Record media key.
304
KEYCODE_MEDIA_REWIND = $00000059; // Rewind media key.
305
KEYCODE_MEDIA_STOP = $00000056; // Stop media key.
306
KEYCODE_MENU = $00000052; // Menu key.
307
KEYCODE_META_LEFT = $00000075; // Left Meta modifier key.
308
KEYCODE_META_RIGHT = $00000076; // Right Meta modifier key.
309
KEYCODE_MINUS = $00000045; // '-'
310
KEYCODE_MOVE_END = $0000007b; // End Movement key. Used for scrolling or moving the cursor around to the end of a line or to the bottom of a list.
311
KEYCODE_MOVE_HOME = $0000007a; // Home Movement key. Used for scrolling or moving the cursor around to the start of a line or to the top of a list.
312
KEYCODE_MUSIC = $000000d1; // Music special function key. Used to launch a music player application.
313
KEYCODE_MUTE = $0000005b; //Mute key. Mutes the microphone, unlike KEYCODE_VOLUME_MUTE
315
KEYCODE_NOTIFICATION = $00000053;
316
KEYCODE_NUM = $0000004e; // Number modifier key. Used to enter numeric symbols. This key is not Num Lock; it is more like KEYCODE_ALT_LEFT and is interpreted as an ALT key by MetaKeyKeyListener.
317
KEYCODE_NUMPAD_0 = $00000090;
318
KEYCODE_NUMPAD_1 = $00000091;
319
KEYCODE_NUMPAD_2 = $00000092;
320
KEYCODE_NUMPAD_3 = $00000093;
321
KEYCODE_NUMPAD_4 = $00000094;
322
KEYCODE_NUMPAD_5 = $00000095;
323
KEYCODE_NUMPAD_6 = $00000096;
324
KEYCODE_NUMPAD_7 = $00000097;
325
KEYCODE_NUMPAD_8 = $00000098;
326
KEYCODE_NUMPAD_9 = $00000099;
327
KEYCODE_NUMPAD_ADD = $0000009d;
328
KEYCODE_NUMPAD_COMMA = $0000009f;
329
KEYCODE_NUMPAD_DIVIDE = $0000009a;
330
KEYCODE_NUMPAD_DOT = $0000009e;
331
KEYCODE_NUMPAD_ENTER = $000000a0;
332
KEYCODE_NUMPAD_EQUALS = $000000a1;
333
KEYCODE_NUMPAD_LEFT_PAREN = $000000a2;
334
KEYCODE_NUMPAD_MULTIPLY = $0000009b;
335
KEYCODE_NUMPAD_RIGHT_PAREN = $000000a3;
336
KEYCODE_NUMPAD_SUBTRACT = $0000009c;
337
KEYCODE_NUM_LOCK = $0000008f;
340
KEYCODE_PAGE_DOWN = $0000005d;
341
KEYCODE_PAGE_UP = $0000005c;
342
KEYCODE_PERIOD = $00000038;
343
KEYCODE_PICTSYMBOLS = $0000005e;
344
KEYCODE_PLUS = $00000051; // '+' key
345
KEYCODE_POUND = $00000012; // '#' key.
346
KEYCODE_POWER = $0000001a;
347
KEYCODE_PROG_BLUE = $000000ba;
348
KEYCODE_PROG_GREEN = $000000b8;
349
KEYCODE_PROG_RED = $000000b7;
350
KEYCODE_PROG_YELLOW = $000000b9;
353
KEYCODE_RIGHT_BRACKET = $00000048;
355
KEYCODE_SCROLL_LOCK = $00000074;
356
KEYCODE_SEARCH = $00000054;
357
KEYCODE_SEMICOLON = $0000004a;
358
KEYCODE_SETTINGS = $000000b0;
359
KEYCODE_SHIFT_LEFT = 59;
360
KEYCODE_SHIFT_RIGHT = 60;
361
KEYCODE_SLASH = $0000004c; // '/' key.
362
KEYCODE_SOFT_LEFT = $00000001;
363
KEYCODE_SOFT_RIGHT = $00000002;
364
KEYCODE_SPACE = $0000003e;
365
KEYCODE_STAR = $00000011;
366
KEYCODE_STB_INPUT = $000000b4;
367
KEYCODE_STB_POWER = $000000b3;
368
KEYCODE_SWITCH_CHARSET = $0000005f;
369
KEYCODE_SYM = $0000003f; // Symbol modifier key. Used to enter alternate symbols.
370
KEYCODE_SYSRQ = $00000078; // System Request / Print Screen key.
372
KEYCODE_TAB = $0000003d;
373
KEYCODE_TV = $000000aa;
374
KEYCODE_TV_INPUT = $000000b2;
375
KEYCODE_TV_POWER = $000000b1;
379
KEYCODE_VOLUME_DOWN = $00000019;
380
KEYCODE_VOLUME_MUTE = $000000a4;
381
KEYCODE_VOLUME_UP = $00000018;
383
KEYCODE_WINDOW = $000000ab; // Window key. On TV remotes, toggles picture-in-picture mode or other windowing functions.
387
KEYCODE_ZOOM_IN = $000000a8;
388
KEYCODE_ZOOM_OUT = $000000a9;
389
MAX_KEYCODE = $00000054; // deprecated!
390
META_ALT_LEFT_ON = $00000010;
391
META_ALT_MASK = $00000032;
392
META_ALT_ON = $00000002;
393
META_ALT_RIGHT_ON = $00000020;
394
META_CAPS_LOCK_ON = $00100000;
395
META_CTRL_LEFT_ON = $00002000;
396
META_CTRL_MASK = $00007000;
397
META_CTRL_ON = $00001000;
398
META_CTRL_RIGHT_ON = $00004000;
399
META_FUNCTION_ON = $00000008;
400
META_META_LEFT_ON = $00020000;
401
META_META_MASK = $00070000;
402
META_META_ON = $00010000;
403
META_META_RIGHT_ON = $00040000;
404
META_NUM_LOCK_ON = $00200000;
405
META_SCROLL_LOCK_ON = $00400000;
406
META_SHIFT_LEFT_ON = $00000040;
407
META_SHIFT_MASK = $000000c1;
408
META_SHIFT_ON = $00000001;
409
META_SHIFT_RIGHT_ON = $00000080;