-
Notifications
You must be signed in to change notification settings - Fork 0
/
BTKeyCodes.h
209 lines (201 loc) · 5.37 KB
/
BTKeyCodes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/*
* Copyright (c) 2016 Evan Kale
* Email: EvanKale91@gmail.com
* Website: www.ISeeDeadPixel.com
* www.evankale.blogspot.ca
*
* This file is part of ArduinoMidiPS2.
*
* ArduinoMidiPS2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BTKEYCODES_H
#define BTKEYCODES_H
/*
//modifier codes
#define BTMC_NONE 0x00
#define BTMC_CTRL_LEFT 0x01
#define BTMC_SHIFT_LEFT 0x02
#define BTMC_ALT_LEFT 0x04
#define BTMC_GUI_LEFT 0x08
#define BTMC_CTRL_RIGHT 0x10
#define BTMC_SHIFT_RIGHT 0x20
#define BTMC_ALT_RIGHT 0x40
#define BTMC_GUI_RIGHT 0x80
*/
//consumer codes
#define BTCC_NONE 0x0000
#define BTCC_HOME 0x0001
#define BTCC_EMAIL 0x0002
#define BTCC_SEARCH 0x0004
#define BTCC_KEYBOARD_LAYOUT 0x0008
#define BTCC_VOLUME_UP 0x0010
#define BTCC_VOLUME_DOWN 0x0020
#define BTCC_MUTE 0x0040
#define BTCC_PLAY_PAUSE 0x0080
#define BTCC_NEXT_TRACK 0x0100
#define BTCC_PREVIOUS_TRACK 0x0200
#define BTCC_STOP 0x0400
#define BTCC_EJECT 0x0800
#define BTCC_FAST_FORWARD 0x1000
#define BTCC_REWIND 0x2000
#define BTCC_STOP_EJECT 0x4000
#define BTCC_BROWSER 0x8000
//keycodes (MODIFIED FOR MAGIC MUSIC KEYBOARD)
#define BTKC_NONE 0
#define BTKC_1 1
#define BTKC_Q 2
#define BTKC_A 3
#define BTKC_Z 4
#define BTKC_2 5
#define BTKC_W 6
#define BTKC_S 7
#define BTKC_X 8
#define BTKC_3 9
#define BTKC_E 10
#define BTKC_D 11
#define BTKC_C 12
#define BTKC_4 13
#define BTKC_R 14
#define BTKC_F 15
#define BTKC_V 16
#define BTKC_5 17
#define BTKC_T 18
#define BTKC_G 19
#define BTKC_B 20
#define BTKC_6 21
#define BTKC_Y 22
#define BTKC_H 23
#define BTKC_N 24
#define BTKC_7 25
#define BTKC_U 26
#define BTKC_J 27
#define BTKC_M 28
#define BTKC_8 29
#define BTKC_I 30
#define BTKC_K 31
#define BTKC_9 32
#define BTKC_O 33
#define BTKC_L 34
#define BTKC_0 35
#define BTKC_P 36
#define BTKC_RETURN 58
#define BTKC_ESCAPE 62
#define BTKC_BACKSPACE 60
#define BTKC_TAB 63
#define BTKC_SPACE 59
#define BTKC_MINUS 64
#define BTKC_EQUAL 65
#define BTKC_BRACKET_LEFT 66
#define BTKC_BRACKET_RIGHT 67
#define BTKC_BACKSLASH 68
#define BTKC_EUROPE_1 69
#define BTKC_SEMICOLON 70
#define BTKC_APOSTROPHE 71
#define BTKC_GRAVE 72
#define BTKC_COMMA 73
#define BTKC_PERIOD 74
#define BTKC_SLASH 75
#define BTKC_CAPS_LOCK 76
#define BTKC_F1 37
#define BTKC_F2 38
#define BTKC_F3 39
#define BTKC_F4 40
#define BTKC_F5 41
#define BTKC_F6 42
#define BTKC_F7 43
#define BTKC_F8 44
#define BTKC_F9 45
#define BTKC_F10 46
#define BTKC_F11 47
#define BTKC_F12 48
#define BTKC_PRINT_SCREEN 77
#define BTKC_SCROLL_LOCK 78
#define BTKC_PAUSE 79
#define BTKC_INSERT 80
#define BTKC_HOME 81
#define BTKC_PAGE_UP 82
#define BTKC_DELETE 83
#define BTKC_END 84
#define BTKC_PAGE_DOWN 85
#define BTKC_ARROW_RIGHT 86
#define BTKC_ARROW_LEFT 87
#define BTKC_ARROW_DOWN 88
#define BTKC_ARROW_UP 89
#define BTKC_NUM_LOCK 90
#define BTKC_KEYPAD_DIVIDE 91
#define BTKC_KEYPAD_MULTIPLY 92
#define BTKC_KEYPAD_SUBTRACT 93
#define BTKC_KEYPAD_ADD 94
#define BTKC_KEYPAD_ENTER 61
#define BTKC_KEYPAD_1 49
#define BTKC_KEYPAD_2 50
#define BTKC_KEYPAD_3 51
#define BTKC_KEYPAD_4 52
#define BTKC_KEYPAD_5 53
#define BTKC_KEYPAD_6 54
#define BTKC_KEYPAD_7 55
#define BTKC_KEYPAD_8 56
#define BTKC_KEYPAD_9 104
#define BTKC_KEYPAD_0 95
#define BTKC_KEYPAD_DECIMAL 96
#define BTKC_EUROPE_2 97
#define BTKC_APPLICATION 98
#define BTKC_POWER 99
#define BTKC_KEYPAD_EQUAL 100
#define BTKC_F13 101
#define BTKC_F14 102
#define BTKC_F15 103
#define BTKC_MENU 107
//highest bit masked with 1 is a virtual keycode
//ie, 0x80 = 1000000b
//0x80 to 0x87 are modifer keys
// the lower 7 bits defines how much 0x1 is shifted left to get the modifier code
// ie) BTKC_ALT_LEFT = 0x82 (10000010b)
// lower 7 bits = 0x02 (0000010b)
// 0x1 << 2 = 100b = 0x04 = BTMC_ALT_LEFT
#define BTKC_CTRL_LEFT 0x11 //80
#define BTKC_SHIFT_LEFT 0x12 //81
#define BTKC_ALT_LEFT 0x19 //82
#define BTKC_GUI_LEFT 0x83 //83
#define BTKC_CTRL_RIGHT 0x58 //84
#define BTKC_SHIFT_RIGHT 0x59 //85
#define BTKC_ALT_RIGHT 0x39 //86
#define BTKC_GUI_RIGHT 105 //87
//0xC0 to 0xD0 are consumer keys
// the lower 6 bits defines how much 0x1 is shifted left to get the 2 byte consumer code
// ie) BTKC_VOLUME_UP = 0xC4 (11000100b)
// lower 6 bits = 0x04 (000100b)
// 0x1 << 4 = 10000b = 0x0010 = BTCC_VOLUME_UP
//consumer codes
#define BTKC_HOMEPAGE 0xC0
#define BTKC_EMAIL 0xC1
#define BTKC_SEARCH 0xC2
#define BTKC_KEYBOARD_LAYOUT 0xC3
#define BTKC_VOLUME_UP 0xC4
#define BTKC_VOLUME_DOWN 0xC5
#define BTKC_MUTE 0xC6
#define BTKC_PLAY_PAUSE 0xC7
#define BTKC_NEXT_TRACK 0xC8
#define BTKC_PREVIOUS_TRACK 0xC9
#define BTKC_STOP 0xCA
#define BTKC_EJECT 0xCB
#define BTKC_FAST_FORWARD 0xCD
#define BTKC_REWIND 0xCE
#define BTKC_STOP_EJECT 0xCF
#define BTKC_BROWSER 0xD0
//0xE0 to 0xE2 are system keys
#define BTKC_SYSTEM_POWER 0xE0 //0x81
#define BTKC_SYSTEM_SLEEP 0xE1 //0x82
#define BTKC_SYSTEM_WAKE 0xE2 //0x83
#endif //BTKEYCODES_H