blob: 36855c5081c0c26f767969182efe508af2cad9c9 [file] [log] [blame]
Jeff Brown46b9ac0a2010-04-22 18:58:52 -07001/*
2 * Copyright (C) 2010 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 _ANDROID_KEYCODES_H
18#define _ANDROID_KEYCODES_H
19
20/******************************************************************
21 *
22 * IMPORTANT NOTICE:
23 *
24 * This file is part of Android's set of stable system headers
25 * exposed by the Android NDK (Native Development Kit).
26 *
27 * Third-party source AND binary code relies on the definitions
28 * here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES.
29 *
30 * - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES)
31 * - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS
32 * - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY
33 * - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES
34 */
35
36#include <sys/types.h>
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42/*
43 * Key codes.
44 *
45 * XXX: The declarations in <ui/KeycodeLabel.h> should be updated to use these instead.
46 * We should probably move this into android/keycodes.h and add some new API for
47 * getting labels so that we can remove the other tables also in KeycodeLabel.h.
48 */
49enum {
50 KEYCODE_UNKNOWN = 0,
51 KEYCODE_SOFT_LEFT = 1,
52 KEYCODE_SOFT_RIGHT = 2,
53 KEYCODE_HOME = 3,
54 KEYCODE_BACK = 4,
55 KEYCODE_CALL = 5,
56 KEYCODE_ENDCALL = 6,
57 KEYCODE_0 = 7,
58 KEYCODE_1 = 8,
59 KEYCODE_2 = 9,
60 KEYCODE_3 = 10,
61 KEYCODE_4 = 11,
62 KEYCODE_5 = 12,
63 KEYCODE_6 = 13,
64 KEYCODE_7 = 14,
65 KEYCODE_8 = 15,
66 KEYCODE_9 = 16,
67 KEYCODE_STAR = 17,
68 KEYCODE_POUND = 18,
69 KEYCODE_DPAD_UP = 19,
70 KEYCODE_DPAD_DOWN = 20,
71 KEYCODE_DPAD_LEFT = 21,
72 KEYCODE_DPAD_RIGHT = 22,
73 KEYCODE_DPAD_CENTER = 23,
74 KEYCODE_VOLUME_UP = 24,
75 KEYCODE_VOLUME_DOWN = 25,
76 KEYCODE_POWER = 26,
77 KEYCODE_CAMERA = 27,
78 KEYCODE_CLEAR = 28,
79 KEYCODE_A = 29,
80 KEYCODE_B = 30,
81 KEYCODE_C = 31,
82 KEYCODE_D = 32,
83 KEYCODE_E = 33,
84 KEYCODE_F = 34,
85 KEYCODE_G = 35,
86 KEYCODE_H = 36,
87 KEYCODE_I = 37,
88 KEYCODE_J = 38,
89 KEYCODE_K = 39,
90 KEYCODE_L = 40,
91 KEYCODE_M = 41,
92 KEYCODE_N = 42,
93 KEYCODE_O = 43,
94 KEYCODE_P = 44,
95 KEYCODE_Q = 45,
96 KEYCODE_R = 46,
97 KEYCODE_S = 47,
98 KEYCODE_T = 48,
99 KEYCODE_U = 49,
100 KEYCODE_V = 50,
101 KEYCODE_W = 51,
102 KEYCODE_X = 52,
103 KEYCODE_Y = 53,
104 KEYCODE_Z = 54,
105 KEYCODE_COMMA = 55,
106 KEYCODE_PERIOD = 56,
107 KEYCODE_ALT_LEFT = 57,
108 KEYCODE_ALT_RIGHT = 58,
109 KEYCODE_SHIFT_LEFT = 59,
110 KEYCODE_SHIFT_RIGHT = 60,
111 KEYCODE_TAB = 61,
112 KEYCODE_SPACE = 62,
113 KEYCODE_SYM = 63,
114 KEYCODE_EXPLORER = 64,
115 KEYCODE_ENVELOPE = 65,
116 KEYCODE_ENTER = 66,
117 KEYCODE_DEL = 67,
118 KEYCODE_GRAVE = 68,
119 KEYCODE_MINUS = 69,
120 KEYCODE_EQUALS = 70,
121 KEYCODE_LEFT_BRACKET = 71,
122 KEYCODE_RIGHT_BRACKET = 72,
123 KEYCODE_BACKSLASH = 73,
124 KEYCODE_SEMICOLON = 74,
125 KEYCODE_APOSTROPHE = 75,
126 KEYCODE_SLASH = 76,
127 KEYCODE_AT = 77,
128 KEYCODE_NUM = 78,
129 KEYCODE_HEADSETHOOK = 79,
130 KEYCODE_FOCUS = 80, // *Camera* focus
131 KEYCODE_PLUS = 81,
132 KEYCODE_MENU = 82,
133 KEYCODE_NOTIFICATION = 83,
134 KEYCODE_SEARCH = 84,
135 KEYCODE_MEDIA_PLAY_PAUSE= 85,
136 KEYCODE_MEDIA_STOP = 86,
137 KEYCODE_MEDIA_NEXT = 87,
138 KEYCODE_MEDIA_PREVIOUS = 88,
139 KEYCODE_MEDIA_REWIND = 89,
140 KEYCODE_MEDIA_FAST_FORWARD = 90,
141 KEYCODE_MUTE = 91,
142 KEYCODE_PAGE_UP = 92,
143 KEYCODE_PAGE_DOWN = 93
144
145 /* NOTE: If you add a new keycode here you must also add it to:
146 * native/include/android/keycodes.h
147 * frameworks/base/include/ui/KeycodeLabels.h
148 * frameworks/base/core/java/android/view/KeyEvent.java
149 * tools/puppet_master/PuppetMaster.nav_keys.py
150 * frameworks/base/core/res/res/values/attrs.xml
151 */
152};
153
154#ifdef __cplusplus
155}
156#endif
157
158#endif // _ANDROID_KEYCODES_H