1 /* 2 * Copyright 2004-2006, Jérôme Duval. All rights reserved. 3 * Copyright 2005-2010, Axel Dörfler, axeld@pinc-software.de. 4 * Distributed under the terms of the MIT License. 5 */ 6 #ifndef AT_KEYMAP_H 7 #define AT_KEYMAP_H 8 9 10 #include <SupportDefs.h> 11 #include <usb/USB_hid.h> 12 #include <usb/USB_hid_page_consumer.h> 13 #include <usb/USB_hid_page_generic_desktop.h> 14 15 16 #define HID_CONSUMER(code) ((B_HID_USAGE_PAGE_CONSUMER << 16) | (B_HID_UID_CON_##code)) 17 #define HID_GD(code) ((B_HID_USAGE_PAGE_GENERIC_DESKTOP << 16) | (B_HID_UID_GD_##code)) 18 19 20 const static uint32 kATKeycodeMap[] = { 21 0x1, // Esc 1 22 0x12, // 1 23 0x13, // 2 24 0x14, // 3 25 0x15, // 4 26 0x16, // 5 27 0x17, // 6 28 0x18, // 7 29 0x19, // 8 30 0x1a, // 9 10 31 0x1b, // 0 32 0x1c, // - 33 0x1d, // = 34 0x1e, // BACKSPACE 35 0x26, // TAB 36 0x27, // Q 37 0x28, // W 38 0x29, // E 39 0x2a, // R 40 0x2b, // T 20 41 0x2c, // Y 42 0x2d, // U 43 0x2e, // I 44 0x2f, // O 45 0x30, // P 46 0x31, // [ 47 0x32, // ] 48 0x47, // ENTER 49 0x5c, // Left Control 50 0x3c, // A 30 51 0x3d, // S 52 0x3e, // D 53 0x3f, // F 54 0x40, // G 55 0x41, // H 56 0x42, // J 57 0x43, // K 58 0x44, // L 59 0x45, // ; 60 0x46, // ' 40 61 0x11, // ` 62 0x4b, // Left Shift 63 0x33, // \ (backslash -- note: don't remove non-white-space after BS char) 64 0x4c, // Z 65 0x4d, // X 66 0x4e, // C 67 0x4f, // V 68 0x50, // B 69 0x51, // N 70 0x52, // M 50 71 0x53, // , 72 0x54, // . 73 0x55, // / 74 0x56, // Right Shift 75 0x24, // * 76 0x5d, // Left Alt 77 0x5e, // Space 78 0x3b, // Caps 79 0x02, // F1 80 0x03, // F2 60 81 0x04, // F3 82 0x05, // F4 83 0x06, // F5 84 0x07, // F6 85 0x08, // F7 86 0x09, // F8 87 0x0a, // F9 88 0x0b, // F10 89 0x22, // Num 90 0x0f, // Scroll 70 91 0x37, // KP 7 92 0x38, // KP 8 93 0x39, // KP 9 94 0x25, // KP - 95 0x48, // KP 4 96 0x49, // KP 5 97 0x4a, // KP 6 98 0x3a, // KP + 99 0x58, // KP 1 100 0x59, // KP 2 80 101 0x5a, // KP 3 102 0x64, // KP 0 103 0x65, // KP . 104 0x7e, // SystReq 105 0x00, // UNMAPPED 106 0x69, // < 107 0x0c, // F11 108 0x0d, // F12 109 0x00, // UNMAPPED 110 0x00, // UNMAPPED 90 111 0x00, // UNMAPPED 112 0x00, // UNMAPPED 113 0x00, // UNMAPPED 114 0x00, // UNMAPPED 115 0x00, // UNMAPPED 116 0x00, // UNMAPPED 117 0x00, // UNMAPPED 118 0x00, // UNMAPPED 119 0x00, // UNMAPPED 120 0x00, // UNMAPPED 100 121 0x00, // UNMAPPED 122 0x00, // UNMAPPED 123 0x00, // UNMAPPED 124 0x00, // UNMAPPED 125 0x00, // UNMAPPED 126 0x00, // UNMAPPED 127 0x00, // UNMAPPED 128 0x00, // UNMAPPED 129 0x00, // UNMAPPED 130 0x00, // UNMAPPED 110 131 0x00, // UNMAPPED 132 0x6e, // Katakana/Hiragana, second key right to spacebar, japanese 133 0x00, // UNMAPPED 134 0x00, // UNMAPPED 135 0x6b, // Ro (\\ key, japanese) 136 0x00, // UNMAPPED 137 0x00, // UNMAPPED 138 0x00, // UNMAPPED 139 0x00, // UNMAPPED 140 0x00, // UNMAPPED 120 141 0x6d, // Henkan, first key right to spacebar, japanese 142 0x00, // UNMAPPED 143 0x6c, // Muhenkan, key left to spacebar, japanese 144 0x00, // UNMAPPED 145 0x6a, // Yen (macron key, japanese) 146 0x70, // Keypad . on Brazilian ABNT2 147 0x00, // UNMAPPED 148 0x00, // UNMAPPED 149 0x00, // UNMAPPED 150 0x00, // UNMAPPED 130 151 0x00, // UNMAPPED 152 0x00, // UNMAPPED 153 0x00, // UNMAPPED 154 0x00, // UNMAPPED 155 0x00, // UNMAPPED 156 0x00, // UNMAPPED 157 0x00, // UNMAPPED 158 0x00, // UNMAPPED 159 0x00, // UNMAPPED 160 0x00, // UNMAPPED 140 161 0x00, // UNMAPPED 162 0x00, // UNMAPPED 163 0x00, // UNMAPPED 164 HID_CONSUMER(SCAN_PREVIOUS_TRACK), // media: Previous track 165 0x00, // UNMAPPED 166 0x00, // UNMAPPED 167 0x00, // UNMAPPED 168 0x00, // UNMAPPED 169 0x00, // UNMAPPED 170 0x00, // UNMAPPED 150 171 0x00, // UNMAPPED 172 0x00, // UNMAPPED 173 HID_CONSUMER(SCAN_NEXT_TRACK), // media: Next track 174 0x00, // UNMAPPED 175 0x00, // UNMAPPED 176 0x5b, // KP Enter 177 0x60, // Right Control 178 0x00, // UNMAPPED 179 0x00, // UNMAPPED 180 HID_CONSUMER(MUTE), // media: Volume mute 160 181 HID_CONSUMER(AL_CALCULATOR), // media: Calculator 182 HID_CONSUMER(PLAY), // media: Play 183 0x00, // UNMAPPED 184 HID_CONSUMER(STOP), // media: Stop 185 0x00, // UNMAPPED 186 0x00, // UNMAPPED 187 0x00, // UNMAPPED 188 0x00, // UNMAPPED 189 0x00, // UNMAPPED 190 0x00, // UNMAPPED 170 191 0x00, // UNMAPPED 192 0x00, // UNMAPPED 193 0x00, // UNMAPPED 194 HID_CONSUMER(VOLUME_DECREMENT), // media: Volume down 195 0x00, // UNMAPPED 196 HID_CONSUMER(VOLUME_INCREMENT), // media: Volume up 197 0x00, // UNMAPPED 198 HID_CONSUMER(AC_HOME), // media: www home 199 0x00, // UNMAPPED 200 0x00, // UNMAPPED 180 201 0x23, // KP / 202 0x00, // UNMAPPED 203 0x0e, // Print Screen 204 0x5f, // Right Alt 205 0x00, // UNMAPPED 206 0x00, // UNMAPPED 207 0x00, // UNMAPPED 208 0x00, // UNMAPPED 209 0x00, // UNMAPPED 210 0x00, // UNMAPPED 190 211 0x00, // UNMAPPED 212 0x00, // UNMAPPED 213 0x00, // UNMAPPED 214 0x00, // UNMAPPED 215 0x00, // UNMAPPED 216 0x00, // UNMAPPED 217 0x00, // UNMAPPED 218 0x10, // Pause 219 0x20, // Home 220 0x57, // Up Arrow 200 221 0x21, // Page Up 222 0x00, // UNMAPPED 223 0x61, // Left Arrow 224 0x00, // UNMAPPED 225 0x63, // Right Arrow 226 0x00, // UNMAPPED 227 0x35, // End 228 0x62, // Down Arrow 229 0x36, // Page Down 230 0x1f, // Insert 210 231 0x34, // Delete 232 0x00, // UNMAPPED 233 0x00, // UNMAPPED 234 0x00, // UNMAPPED 235 0x00, // UNMAPPED 236 0x00, // UNMAPPED 237 0x00, // UNMAPPED 238 0x00, // UNMAPPED 239 0x66, // Left Gui 240 0x67, // Right Gui 220 241 0x68, // Menu 242 HID_GD(SYSTEM_POWER_DOWN), // power: Shutdown 243 HID_GD(SYSTEM_SLEEP), // power: Sleep 244 0x00, // UNMAPPED 0x60 245 0x00, // UNMAPPED 246 0x00, // UNMAPPED 247 HID_GD(SYSTEM_WAKE_UP), // power: Wake 248 0x00, // UNMAPPED 249 HID_CONSUMER(AC_SEARCH), // media: www Search 250 HID_CONSUMER(AC_BOOKMARKS), // medie: www Favorites 230 251 HID_CONSUMER(AC_REFRESH), // media: www Refresh 252 HID_CONSUMER(AC_STOP), // media: www Stop 253 HID_CONSUMER(AC_FORWARD), // media: www Forward 254 HID_CONSUMER(AC_BACK), // media: www back 255 HID_CONSUMER(AL_LOCAL_MACHINE_BROWSER), // media: My computer 256 HID_CONSUMER(AL_EMAIL_READER), // media: email 257 HID_CONSUMER(AL_CONSUMER_CONTROL_CONFIGURATION), // media: select 258 0x00, // UNMAPPED 259 0x00, // UNMAPPED 260 0x00, // UNMAPPED 261 0x00, // UNMAPPED 262 0x00, // UNMAPPED 263 0x00, // UNMAPPED 264 0x00, // UNMAPPED 265 0x00, // UNMAPPED 266 0x00, // UNMAPPED 267 0x00, // UNMAPPED 268 0x00, // UNMAPPED 269 0x00, // UNMAPPED 270 0x00, // UNMAPPED 271 0x00, // UNMAPPED 272 0x00, // UNMAPPED 273 0x00, // UNMAPPED 274 0x00, // UNMAPPED 275 0x00, // UNMAPPED 276 0x00, // UNMAPPED 277 0x00, // UNMAPPED 278 0x00, // UNMAPPED 279 0x00, // UNMAPPED 280 0x00, // UNMAPPED 281 0x00, // UNMAPPED 282 0x00, // UNMAPPED 283 0x00, // UNMAPPED 284 0x00, // UNMAPPED 285 0x00, // UNMAPPED 286 0x00, // UNMAPPED 287 0x00, // UNMAPPED 288 0x00, // UNMAPPED 289 0x00, // UNMAPPED 290 0x00, // UNMAPPED 291 0x00, // UNMAPPED 292 0x00, // UNMAPPED 293 0x00, // UNMAPPED 294 0x00, // UNMAPPED 295 0x00, // UNMAPPED 296 0x00, // UNMAPPED 297 0x00, // UNMAPPED 298 0x00, // UNMAPPED 299 0x00, // UNMAPPED 300 0x00, // UNMAPPED 301 0x00, // UNMAPPED 302 0x00, // UNMAPPED 303 0x00, // UNMAPPED 304 0x00, // UNMAPPED 305 0x00, // UNMAPPED 306 0x00, // UNMAPPED 307 0x00, // UNMAPPED 308 0x00, // UNMAPPED 309 0x00, // UNMAPPED 310 0x00, // UNMAPPED 311 }; 312 313 314 #endif // AT_KEYMAP_H 315