diff options
Diffstat (limited to 'app/usb_scancodes.h')
-rw-r--r-- | app/usb_scancodes.h | 195 |
1 files changed, 195 insertions, 0 deletions
diff --git a/app/usb_scancodes.h b/app/usb_scancodes.h new file mode 100644 index 0000000..4d84ed4 --- /dev/null +++ b/app/usb_scancodes.h @@ -0,0 +1,195 @@ +#ifndef _USB_SCANCODES_H_ +#define _USB_SCANCODES_H_ + +#define USB_K_SC_ESC 0x29 /* 0x01, Keyboard ESCAPE */ +#define USB_K_SC_1 0x1e /* 0x02, Keyboard 1 and ! */ +#define USB_K_SC_2 0x1f /* 0x03, Keyboard 2 and @ */ +#define USB_K_SC_3 0x20 /* 0x04, Keyboard 3 and # */ +#define USB_K_SC_4 0x21 /* 0x05, Keyboard 4 and $ */ +#define USB_K_SC_5 0x22 /* 0x06, Keyboard 5 and % */ +#define USB_K_SC_6 0x23 /* 0x07, Keyboard 6 and ^ */ +#define USB_K_SC_7 0x24 /* 0x08, Keyboard 7 and & */ +#define USB_K_SC_8 0x25 /* 0x09, Keyboard 8 and * */ +#define USB_K_SC_9 0x26 /* 0x0a, Keyboard 9 and ( */ +#define USB_K_SC_0 0x27 /* 0x0b, Keyboard 0 and ) */ +#define USB_K_SC_MINUS 0x2d /* 0x0c, Keyboard - and (underscore) */ +#define USB_K_SC_EQUAL 0x2e /* 0x0d, Keyboard = and + */ +#define USB_K_SC_BACKSPACE 0x2a /* 0x0e, Keyboard DELETE (Backspace) */ +#define USB_K_SC_TAB 0x2b /* 0x0f, Keyboard Tab */ +#define USB_K_SC_Q 0x14 /* 0x10, Keyboard q and Q */ +#define USB_K_SC_W 0x1a /* 0x11, Keyboard w and W */ +#define USB_K_SC_E 0x08 /* 0x12, Keyboard e and E */ +#define USB_K_SC_R 0x15 /* 0x13, Keyboard r and R */ +#define USB_K_SC_T 0x17 /* 0x14, Keyboard t and T */ +#define USB_K_SC_Y 0x1c /* 0x15, Keyboard y and Y */ +#define USB_K_SC_U 0x18 /* 0x16, Keyboard u and U */ +#define USB_K_SC_I 0x0c /* 0x17, Keyboard i and I */ +#define USB_K_SC_O 0x12 /* 0x18, Keyboard o and O */ +#define USB_K_SC_P 0x13 /* 0x19, Keyboard p and P */ +#define USB_K_SC_LEFTBRACE 0x2f /* 0x1a, Keyboard [ and { */ +#define USB_K_SC_RIGHTBRACE 0x30 /* 0x1b, Keyboard ] and } */ +#define USB_K_SC_ENTER 0x28 /* 0x1c, Keyboard Return (ENTER) */ +#define USB_K_SC_LEFTCTRL 0xe0 /* 0x1d, Keyboard LeftControl */ +#define USB_K_SC_A 0x04 /* 0x1e, Keyboard a and A */ +#define USB_K_SC_S 0x16 /* 0x1f, Keyboard s and S */ +#define USB_K_SC_D 0x07 /* 0x20, Keyboard d and D */ +#define USB_K_SC_F 0x09 /* 0x21, Keyboard f and F */ +#define USB_K_SC_G 0x0a /* 0x22, Keyboard g and G */ +#define USB_K_SC_H 0x0b /* 0x23, Keyboard h and H */ +#define USB_K_SC_J 0x0d /* 0x24, Keyboard j and J */ +#define USB_K_SC_K 0x0e /* 0x25, Keyboard k and K */ +#define USB_K_SC_L 0x0f /* 0x26, Keyboard l and L */ +#define USB_K_SC_SEMICOLON 0x33 /* 0x27, Keyboard ; and : */ +#define USB_K_SC_APOSTROPHE 0x34 /* 0x28, Keyboard ' and " */ +#define USB_K_SC_GRAVE 0x35 /* 0x29, Keyboard Grave Accent and Tilde */ +#define USB_K_SC_LEFTSHIFT 0xe1 /* 0x2a, Keyboard LeftShift */ +#define USB_K_SC_BACKSLASH 0x32 /* 0x2b, Keyboard Non-US # and ~ */ +#define USB_K_SC_Z 0x1d /* 0x2c, Keyboard z and Z */ +#define USB_K_SC_X 0x1b /* 0x2d, Keyboard x and X */ +#define USB_K_SC_C 0x06 /* 0x2e, Keyboard c and C */ +#define USB_K_SC_V 0x19 /* 0x2f, Keyboard v and V */ +#define USB_K_SC_B 0x05 /* 0x30, Keyboard b and B */ +#define USB_K_SC_N 0x11 /* 0x31, Keyboard n and N */ +#define USB_K_SC_M 0x10 /* 0x32, Keyboard m and M */ +#define USB_K_SC_COMMA 0x36 /* 0x33, Keyboard, and < */ +#define USB_K_SC_DOT 0x37 /* 0x34, Keyboard.and > */ +#define USB_K_SC_SLASH 0x38 /* 0x35, Keyboard / and ? */ +#define USB_K_SC_RIGHTSHIFT 0xe5 /* 0x36, Keyboard RightShift */ +#define USB_K_SC_KPASTERISK 0x55 /* 0x37, Keypad * */ +#define USB_K_SC_LEFTALT 0xe2 /* 0x38, Keyboard LeftAlt */ +#define USB_K_SC_SPACE 0x2c /* 0x39, Keyboard Spacebar */ +#define USB_K_SC_CAPSLOCK 0x39 /* 0x3a, Keyboard Caps Lock */ +#define USB_K_SC_F1 0x3a /* 0x3b, Keyboard F1 */ +#define USB_K_SC_F2 0x3b /* 0x3c, Keyboard F2 */ +#define USB_K_SC_F3 0x3c /* 0x3d, Keyboard F3 */ +#define USB_K_SC_F4 0x3d /* 0x3e, Keyboard F4 */ +#define USB_K_SC_F5 0x3e /* 0x3f, Keyboard F5 */ +#define USB_K_SC_F6 0x3f /* 0x40, Keyboard F6 */ +#define USB_K_SC_F7 0x40 /* 0x41, Keyboard F7 */ +#define USB_K_SC_F8 0x41 /* 0x42, Keyboard F8 */ +#define USB_K_SC_F9 0x42 /* 0x43, Keyboard F9 */ +#define USB_K_SC_F10 0x43 /* 0x44, Keyboard F10 */ +#define USB_K_SC_NUMLOCK 0x53 /* 0x45, Keypad Num Lock and Clear */ +#define USB_K_SC_SCROLLLOCK 0x47 /* 0x46, Keyboard Scroll Lock */ +#define USB_K_SC_KP7 0x5f /* 0x47, Keypad 7 and Home */ +#define USB_K_SC_KP8 0x60 /* 0x48, Keypad 8 and Up Arrow */ +#define USB_K_SC_KP9 0x61 /* 0x49, Keypad 9 and PageUp */ +#define USB_K_SC_KPMINUS 0x56 /* 0x4a, Keypad - */ +#define USB_K_SC_KP4 0x5c /* 0x4b, Keypad 4 and Left Arrow */ +#define USB_K_SC_KP5 0x5d /* 0x4c, Keypad 5 */ +#define USB_K_SC_KP6 0x5e /* 0x4d, Keypad 6 and Right Arrow */ +#define USB_K_SC_KPPLUS 0x57 /* 0x4e, Keypad + */ +#define USB_K_SC_KP1 0x59 /* 0x4f, Keypad 1 and End */ +#define USB_K_SC_KP2 0x5a /* 0x50, Keypad 2 and Down Arrow */ +#define USB_K_SC_KP3 0x5b /* 0x51, Keypad 3 and PageDn */ +#define USB_K_SC_KP0 0x62 /* 0x52, Keypad 0 and Insert */ +#define USB_K_SC_KPDOT 0x63 /* 0x53, Keypad.and Delete */ +#define USB_K_SC_ZENKAKUHANKAKU 0x94 /* 0x55, Keyboard LANG5 */ +#define USB_K_SC_102ND 0x64 /* 0x56, Keyboard Non - US \ and | */ +#define USB_K_SC_F11 0x44 /* 0x57, Keyboard F11 */ +#define USB_K_SC_F12 0x45 /* 0x58, Keyboard F12 */ +#define USB_K_SC_RO 0x87 /* 0x59, Keyboard International1 */ +#define USB_K_SC_KATAKANA 0x92 /* 0x5a, Keyboard LANG3 */ +#define USB_K_SC_HIRAGANA 0x93 /* 0x5b, Keyboard LANG4 */ +#define USB_K_SC_HENKAN 0x8a /* 0x5c, Keyboard International4 */ +#define USB_K_SC_KATAKANAHIRAGANA 0x88 /* 0x5d, Keyboard International2 */ +#define USB_K_SC_MUHENKAN 0x8b /* 0x5e, Keyboard International5 */ +#define USB_K_SC_KPJPCOMMA 0x8c /* 0x5f, Keyboard International6 */ +#define USB_K_SC_KPENTER 0x58 /* 0x60, Keypad ENTER */ +#define USB_K_SC_RIGHTCTRL 0xe4 /* 0x61, Keyboard RightControl */ +#define USB_K_SC_KPSLASH 0x54 /* 0x62, Keypad / */ +#define USB_K_SC_SYSRQ 0x46 /* 0x63, Keyboard PrintScreen */ +#define USB_K_SC_RIGHTALT 0xe6 /* 0x64, Keyboard RightAlt */ +#define USB_K_SC_HOME 0x4a /* 0x66, Keyboard Home */ +#define USB_K_SC_UP 0x52 /* 0x67, Keyboard UpArrow */ +#define USB_K_SC_PAGEUP 0x4b /* 0x68, Keyboard PageUp */ +#define USB_K_SC_LEFT 0x50 /* 0x69, Keyboard LeftArrow */ +#define USB_K_SC_RIGHT 0x4f /* 0x6a, Keyboard RightArrow */ +#define USB_K_SC_END 0x4d /* 0x6b, Keyboard End */ +#define USB_K_SC_DOWN 0x51 /* 0x6c, Keyboard DownArrow */ +#define USB_K_SC_PAGEDOWN 0x4e /* 0x6d, Keyboard PageDown */ +#define USB_K_SC_INSERT 0x49 /* 0x6e, Keyboard Insert */ +#define USB_K_SC_DELETE 0xd8 /* 0x6f */ +#define USB_K_SC_MUTE 0xef /* 0x71 */ +#define USB_K_SC_VOLUMEDOWN 0xee /* 0x72 */ +#define USB_K_SC_VOLUMEUP 0xed /* 0x73 */ +#define USB_K_SC_POWER 0x66 /* 0x74, Keyboard Power */ +#define USB_K_SC_KPEQUAL 0x67 /* 0x75, Keypad = */ +#define USB_K_SC_PAUSE 0x48 /* 0x77, Keyboard Pause */ +#define USB_K_SC_KPCOMMA 0x85 /* 0x79, Keypad Comma */ +#define USB_K_SC_HANGEUL 0x90 /* 0x7a, Keyboard LANG1 */ +#define USB_K_SC_HANJA 0x91 /* 0x7b, Keyboard LANG2 */ +#define USB_K_SC_YEN 0x89 /* 0x7c, Keyboard International3 */ +#define USB_K_SC_LEFTMETA 0xe3 /* 0x7d, Keyboard Left GUI */ +#define USB_K_SC_RIGHTMETA 0xe7 /* 0x7e, Keyboard Right GUI */ +#define USB_K_SC_COMPOSE 0x65 /* 0x7f, Keyboard Application */ +#define USB_K_SC_STOP 0xf3 /* 0x80 */ +#define USB_K_SC_AGAIN 0x79 /* 0x81, Keyboard Again */ +#define USB_K_SC_MENU 0x76 /* 0x82, Keyboard Menu */ +#define USB_K_SC_UNDO 0x7a /* 0x83, Keyboard Undo */ +#define USB_K_SC_FRONT 0x77 /* 0x84, Keyboard Select */ +#define USB_K_SC_COPY 0x7c /* 0x85, Keyboard Copy */ +#define USB_K_SC_OPEN 0x74 /* 0x86, Keyboard Execute */ +#define USB_K_SC_PASTE 0x7d /* 0x87, Keyboard Paste */ +#define USB_K_SC_FIND 0xf4 /* 0x88 */ +#define USB_K_SC_CUT 0x7b /* 0x89, Keyboard Cut */ +#define USB_K_SC_HELP 0x75 /* 0x8a, Keyboard Help */ +#define USB_K_SC_CALC 0xfb /* 0x8c */ +#define USB_K_SC_SLEEP 0xf8 /* 0x8e */ +#define USB_K_SC_WWW 0xf0 /* 0x96 */ +#define USB_K_SC_COFFEE 0xf9 /* 0x98 */ +#define USB_K_SC_BACK 0xf1 /* 0x9e */ +#define USB_K_SC_FORWARD 0xf2 /* 0x9f */ +#define USB_K_SC_EJECTCD 0xec /* 0xa1 */ +#define USB_K_SC_NEXTSONG 0xeb /* 0xa3 */ +#define USB_K_SC_PLAYPAUSE 0xe8 /* 0xa4 */ +#define USB_K_SC_PREVIOUSSONG 0xea /* 0xa5 */ +#define USB_K_SC_STOPCD 0xe9 /* 0xa6 */ +#define USB_K_SC_REFRESH 0xfa /* 0xad */ +#define USB_K_SC_EDIT 0xf7 /* 0xb0 */ +#define USB_K_SC_SCROLLUP 0xf5 /* 0xb1 */ +#define USB_K_SC_SCROLLDOWN 0xf6 /* 0xb2 */ +#define USB_K_SC_KPLEFTPAREN 0xb6 /* 0xb3 */ +#define USB_K_SC_KPRIGHTPAREN 0xb7 /* 0xb4 */ +#define USB_K_SC_F13 0x68 /* 0xb7, Keyboard F13 */ +#define USB_K_SC_F14 0x69 /* 0xb8, Keyboard F14 */ +#define USB_K_SC_F15 0x6a /* 0xb9, Keyboard F15 */ +#define USB_K_SC_F16 0x6b /* 0xba, Keyboard F16 */ +#define USB_K_SC_F17 0x6c /* 0xbb, Keyboard F17 */ +#define USB_K_SC_F18 0x6d /* 0xbc, Keyboard F18 */ +#define USB_K_SC_F19 0x6e /* 0xbd, Keyboard F19 */ +#define USB_K_SC_F20 0x6f /* 0xbe, Keyboard F20 */ +#define USB_K_SC_F21 0x70 /* 0xbf, Keyboard F21 */ +#define USB_K_SC_F22 0x71 /* 0xc0, Keyboard F22 */ +#define USB_K_SC_F23 0x72 /* 0xc1, Keyboard F23 */ +#define USB_K_SC_F24 0x73 /* 0xc2, Keyboard F24 */ + + +/* these are our bit positions in consumer.c */ + +#define USB_C_BF_NEXTSONG (1 << 0) +#define USB_C_BF_PREVIOUSSONG (1 << 1) +#define USB_C_BF_STOPCD (1 << 2) +#define USB_C_BF_PLAYPAUSE (1 << 3) + +#define USB_C_BF_MUTE (1 << 4) +#define USB_C_BF_VOLUMEUP (1 << 5) +#define USB_C_BF_VOLUMEDOWN (1 << 6) +#define USB_C_BF_SEARCH (1 << 7) + +#define USB_C_BF_HOMEPAGE (1 << 8) +#define USB_C_BF_BACK (1 << 9) +#define USB_C_BF_FORWARD (1 << 10) +#define USB_C_BF_STOP (1 << 11) + +#define USB_C_BF_REFRESH (1 << 12) +#define USB_C_BF_FAVOURITES (1 << 13) +#define USB_C_BF_MAIL (1 << 14) +#define USB_C_BF_CALC (1 << 15) + +#define USB_LED_CAPS 0x02 +#define USB_LED_NUMLOCK 0x01 +#define USB_LED_SCROLLLOCK 0x04 + + +#endif |