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