1 | /**
|
---|
2 | * \file firmware/keycodes.h
|
---|
3 | * \brief This file contains modifier- and keycode definitions according to the
|
---|
4 | * USB-specifications for human interface devices.
|
---|
5 | *
|
---|
6 | * See usb.org's HID-usage-tables document, chapter 10 Keyboard/Keypad Page for
|
---|
7 | * more codes: http://www.usb.org/developers/devclass_docs/Hut1_12.pdf
|
---|
8 | * \author Ronald Schaten <ronald@schatenseite.de>
|
---|
9 | * \version $Id: keycodes.h,v 1.1 2008-07-09 20:47:12 rschaten Exp $
|
---|
10 | *
|
---|
11 | * License: GNU GPL v2 (see License.txt)
|
---|
12 | */
|
---|
13 |
|
---|
14 | #ifndef __keycodes_h_included__
|
---|
15 | #define __keycodes_h_included__
|
---|
16 |
|
---|
17 | /// Codes for modifier-keys.
|
---|
18 | enum modifiers {
|
---|
19 | MOD_NONE = 0,
|
---|
20 | MOD_CONTROL_LEFT = (1 << 0),
|
---|
21 | MOD_SHIFT_LEFT = (1 << 1),
|
---|
22 | MOD_ALT_LEFT = (1 << 2),
|
---|
23 | MOD_GUI_LEFT = (1 << 3),
|
---|
24 | MOD_CONTROL_RIGHT = (1 << 4),
|
---|
25 | MOD_SHIFT_RIGHT = (1 << 5),
|
---|
26 | MOD_ALT_RIGHT = (1 << 6),
|
---|
27 | MOD_GUI_RIGHT = (1 << 7),
|
---|
28 | };
|
---|
29 |
|
---|
30 | /// Codes for non-modifier-keys.
|
---|
31 | enum keycodes {
|
---|
32 | KEY_Reserved = 0, // unused
|
---|
33 | KEY_ErrorRollOver,
|
---|
34 | KEY_POSTFail,
|
---|
35 | KEY_ErrorUndefined,
|
---|
36 | KEY_A, // 0x04
|
---|
37 | KEY_B,
|
---|
38 | KEY_C,
|
---|
39 | KEY_D,
|
---|
40 | KEY_E,
|
---|
41 | KEY_F,
|
---|
42 | KEY_G,
|
---|
43 | KEY_H,
|
---|
44 | KEY_I,
|
---|
45 | KEY_J,
|
---|
46 | KEY_K,
|
---|
47 | KEY_L,
|
---|
48 | KEY_M, // 0x10
|
---|
49 | KEY_N,
|
---|
50 | KEY_O,
|
---|
51 | KEY_P,
|
---|
52 | KEY_Q,
|
---|
53 | KEY_R,
|
---|
54 | KEY_S,
|
---|
55 | KEY_T,
|
---|
56 | KEY_U,
|
---|
57 | KEY_V,
|
---|
58 | KEY_W,
|
---|
59 | KEY_X,
|
---|
60 | KEY_Y,
|
---|
61 | KEY_Z,
|
---|
62 | KEY_1, // 1 and !
|
---|
63 | KEY_2, // 2 and @
|
---|
64 | KEY_3, // 0x20 3 and #
|
---|
65 | KEY_4, // 4 and $
|
---|
66 | KEY_5, // 5 and %
|
---|
67 | KEY_6, // 6 and ^
|
---|
68 | KEY_7, // 7 and &
|
---|
69 | KEY_8, // 8 and *
|
---|
70 | KEY_9, // 9 and (
|
---|
71 | KEY_0, // 0x27 0 and )
|
---|
72 | KEY_Return, // 0x28 enter
|
---|
73 | KEY_ESCAPE, // 0x29
|
---|
74 | KEY_DELETE, // 0x2A backspace
|
---|
75 | KEY_Tab, // 0x2B
|
---|
76 | KEY_Spacebar, // 0x2C
|
---|
77 | KEY_minus, // 0x2D - and _
|
---|
78 | KEY_equals, // 0x2E = and +
|
---|
79 | KEY_lbracket, // 0x2F [ and {
|
---|
80 | KEY_rbracket, // 0x30 ] and }
|
---|
81 | KEY_backslash, // 0x31 \ and |
|
---|
82 | KEY_hash, // 0x32 non-US # and ~
|
---|
83 | KEY_semicolon, // 0x33 ; and :
|
---|
84 | KEY_apostroph, // 0x34 ' and "
|
---|
85 | KEY_grave, // 0x35 grave accent and tilde
|
---|
86 | KEY_comma, // 0x36 , and <
|
---|
87 | KEY_dot, // 0x37 . and >
|
---|
88 | KEY_slash, // 0x38 / and ?
|
---|
89 | KEY_capslock, // 0x39
|
---|
90 | KEY_F1,
|
---|
91 | KEY_F2,
|
---|
92 | KEY_F3,
|
---|
93 | KEY_F4,
|
---|
94 | KEY_F5,
|
---|
95 | KEY_F6,
|
---|
96 | KEY_F7, // 0x40
|
---|
97 | KEY_F8,
|
---|
98 | KEY_F9,
|
---|
99 | KEY_F10,
|
---|
100 | KEY_F11,
|
---|
101 | KEY_F12,
|
---|
102 | KEY_PrintScreen,
|
---|
103 | KEY_ScrollLock,
|
---|
104 | KEY_Pause, // Break
|
---|
105 | KEY_Insert,
|
---|
106 | KEY_Home,
|
---|
107 | KEY_PageUp,
|
---|
108 | KEY_DeleteForward,
|
---|
109 | KEY_End,
|
---|
110 | KEY_PageDown,
|
---|
111 | KEY_RightArrow,
|
---|
112 | KEY_LeftArrow, // 0x50
|
---|
113 | KEY_DownArrow,
|
---|
114 | KEY_UpArrow,
|
---|
115 | KEY_NumLock, // Clear
|
---|
116 | KEY_KPslash,
|
---|
117 | KEY_KPasterisk,
|
---|
118 | KEY_KPminus,
|
---|
119 | KEY_KPplus,
|
---|
120 | KEY_KPenter,
|
---|
121 | KEY_KP1, // End
|
---|
122 | KEY_KP2, // Down Arrow
|
---|
123 | KEY_KP3, // Page Down
|
---|
124 | KEY_KP4, // Left Arrow
|
---|
125 | KEY_KP5,
|
---|
126 | KEY_KP6, // Right Arrow
|
---|
127 | KEY_KP7, // Home
|
---|
128 | KEY_KP8, // 0x60 Up Arrow
|
---|
129 | KEY_KP9, // Page Up
|
---|
130 | KEY_KP0, // Insert
|
---|
131 | KEY_KPcomma, // Delete
|
---|
132 | KEY_Euro, // non-US \ and |
|
---|
133 | KEY_Application,
|
---|
134 |
|
---|
135 | KEY_Help = 0x75,
|
---|
136 | KEY_KPLParen, // should be 0x182, but windows XP doesn't accept keycodes above 7F...
|
---|
137 | KEY_KPRParen,
|
---|
138 | };
|
---|
139 |
|
---|
140 | #endif /* __keycodes_h_included__ */
|
---|
141 |
|
---|