• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 
20 #include <android/keycodes.h>
21 
22 struct KeycodeLabel {
23     const char *literal;
24     int value;
25 };
26 
27 static const KeycodeLabel KEYCODES[] = {
28     { "SOFT_LEFT", 1 },
29     { "SOFT_RIGHT", 2 },
30     { "HOME", 3 },
31     { "BACK", 4 },
32     { "CALL", 5 },
33     { "ENDCALL", 6 },
34     { "0", 7 },
35     { "1", 8 },
36     { "2", 9 },
37     { "3", 10 },
38     { "4", 11 },
39     { "5", 12 },
40     { "6", 13 },
41     { "7", 14 },
42     { "8", 15 },
43     { "9", 16 },
44     { "STAR", 17 },
45     { "POUND", 18 },
46     { "DPAD_UP", 19 },
47     { "DPAD_DOWN", 20 },
48     { "DPAD_LEFT", 21 },
49     { "DPAD_RIGHT", 22 },
50     { "DPAD_CENTER", 23 },
51     { "VOLUME_UP", 24 },
52     { "VOLUME_DOWN", 25 },
53     { "POWER", 26 },
54     { "CAMERA", 27 },
55     { "CLEAR", 28 },
56     { "A", 29 },
57     { "B", 30 },
58     { "C", 31 },
59     { "D", 32 },
60     { "E", 33 },
61     { "F", 34 },
62     { "G", 35 },
63     { "H", 36 },
64     { "I", 37 },
65     { "J", 38 },
66     { "K", 39 },
67     { "L", 40 },
68     { "M", 41 },
69     { "N", 42 },
70     { "O", 43 },
71     { "P", 44 },
72     { "Q", 45 },
73     { "R", 46 },
74     { "S", 47 },
75     { "T", 48 },
76     { "U", 49 },
77     { "V", 50 },
78     { "W", 51 },
79     { "X", 52 },
80     { "Y", 53 },
81     { "Z", 54 },
82     { "COMMA", 55 },
83     { "PERIOD", 56 },
84     { "ALT_LEFT", 57 },
85     { "ALT_RIGHT", 58 },
86     { "SHIFT_LEFT", 59 },
87     { "SHIFT_RIGHT", 60 },
88     { "TAB", 61 },
89     { "SPACE", 62 },
90     { "SYM", 63 },
91     { "EXPLORER", 64 },
92     { "ENVELOPE", 65 },
93     { "ENTER", 66 },
94     { "DEL", 67 },
95     { "GRAVE", 68 },
96     { "MINUS", 69 },
97     { "EQUALS", 70 },
98     { "LEFT_BRACKET", 71 },
99     { "RIGHT_BRACKET", 72 },
100     { "BACKSLASH", 73 },
101     { "SEMICOLON", 74 },
102     { "APOSTROPHE", 75 },
103     { "SLASH", 76 },
104     { "AT", 77 },
105     { "NUM", 78 },
106     { "HEADSETHOOK", 79 },
107     { "FOCUS", 80 },
108     { "PLUS", 81 },
109     { "MENU", 82 },
110     { "NOTIFICATION", 83 },
111     { "SEARCH", 84 },
112     { "MEDIA_PLAY_PAUSE", 85 },
113     { "MEDIA_STOP", 86 },
114     { "MEDIA_NEXT", 87 },
115     { "MEDIA_PREVIOUS", 88 },
116     { "MEDIA_REWIND", 89 },
117     { "MEDIA_FAST_FORWARD", 90 },
118     { "MUTE", 91 },
119     { "PAGE_UP", 92 },
120     { "PAGE_DOWN", 93 },
121     { "PICTSYMBOLS", 94 },
122     { "SWITCH_CHARSET", 95 },
123     { "BUTTON_A", 96 },
124     { "BUTTON_B", 97 },
125     { "BUTTON_C", 98 },
126     { "BUTTON_X", 99 },
127     { "BUTTON_Y", 100 },
128     { "BUTTON_Z", 101 },
129     { "BUTTON_L1", 102 },
130     { "BUTTON_R1", 103 },
131     { "BUTTON_L2", 104 },
132     { "BUTTON_R2", 105 },
133     { "BUTTON_THUMBL", 106 },
134     { "BUTTON_THUMBR", 107 },
135     { "BUTTON_START", 108 },
136     { "BUTTON_SELECT", 109 },
137     { "BUTTON_MODE", 110 },
138 
139     // NOTE: If you add a new keycode here you must also add it to several other files.
140     //       Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.
141 
142     { NULL, 0 }
143 };
144 
145 // See also policy flags in Input.h.
146 static const KeycodeLabel FLAGS[] = {
147     { "WAKE", 0x00000001 },
148     { "WAKE_DROPPED", 0x00000002 },
149     { "SHIFT", 0x00000004 },
150     { "CAPS_LOCK", 0x00000008 },
151     { "ALT", 0x00000010 },
152     { "ALT_GR", 0x00000020 },
153     { "MENU", 0x00000040 },
154     { "LAUNCHER", 0x00000080 },
155     { "VIRTUAL", 0x00000100 },
156     { NULL, 0 }
157 };
158 
159 #endif // _UI_KEYCODE_LABELS_H
160