aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/report.h
diff options
context:
space:
mode:
authorstein3 <stein3@gmail.com>2020-10-06 07:15:41 -0700
committerstein3 <stein3@gmail.com>2020-10-06 07:15:41 -0700
commit2e402741a89c5eec8cf30c966ce6f36d6ec9249b (patch)
tree3592e8c5e6bd19943ae55db7fc02a5f755afbb51 /tmk_core/common/report.h
parent3e5e4f74272c610bb9fa737f674f8e65ed6100ca (diff)
parent2013f6313430b977e557e482d30daa279a46e75d (diff)
downloadqmk_firmware-2e402741a89c5eec8cf30c966ce6f36d6ec9249b.tar.gz
qmk_firmware-2e402741a89c5eec8cf30c966ce6f36d6ec9249b.zip
Merge branch 'master' into meteor
Diffstat (limited to 'tmk_core/common/report.h')
-rw-r--r--tmk_core/common/report.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h
index c2b1b7c71..1aa33c998 100644
--- a/tmk_core/common/report.h
+++ b/tmk_core/common/report.h
@@ -29,7 +29,8 @@ enum hid_report_ids {
29 REPORT_ID_MOUSE, 29 REPORT_ID_MOUSE,
30 REPORT_ID_SYSTEM, 30 REPORT_ID_SYSTEM,
31 REPORT_ID_CONSUMER, 31 REPORT_ID_CONSUMER,
32 REPORT_ID_NKRO 32 REPORT_ID_NKRO,
33 REPORT_ID_JOYSTICK
33}; 34};
34 35
35/* Mouse buttons */ 36/* Mouse buttons */
@@ -46,8 +47,9 @@ enum mouse_buttons {
46 * See https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf#page=75 47 * See https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf#page=75
47 */ 48 */
48enum consumer_usages { 49enum consumer_usages {
49 // 15.5 Display Controls (https://www.usb.org/sites/default/files/hutrr41_0.pdf) 50 // 15.5 Display Controls
50 BRIGHTNESS_UP = 0x06F, 51 SNAPSHOT = 0x065,
52 BRIGHTNESS_UP = 0x06F, // https://www.usb.org/sites/default/files/hutrr41_0.pdf
51 BRIGHTNESS_DOWN = 0x070, 53 BRIGHTNESS_DOWN = 0x070,
52 // 15.7 Transport Controls 54 // 15.7 Transport Controls
53 TRANSPORT_RECORD = 0x0B2, 55 TRANSPORT_RECORD = 0x0B2,
@@ -57,6 +59,7 @@ enum consumer_usages {
57 TRANSPORT_PREV_TRACK = 0x0B6, 59 TRANSPORT_PREV_TRACK = 0x0B6,
58 TRANSPORT_STOP = 0x0B7, 60 TRANSPORT_STOP = 0x0B7,
59 TRANSPORT_EJECT = 0x0B8, 61 TRANSPORT_EJECT = 0x0B8,
62 TRANSPORT_RANDOM_PLAY = 0x0B9,
60 TRANSPORT_STOP_EJECT = 0x0CC, 63 TRANSPORT_STOP_EJECT = 0x0CC,
61 TRANSPORT_PLAY_PAUSE = 0x0CD, 64 TRANSPORT_PLAY_PAUSE = 0x0CD,
62 // 15.9.1 Audio Controls - Volume 65 // 15.9.1 Audio Controls - Volume
@@ -71,6 +74,7 @@ enum consumer_usages {
71 AL_LOCK = 0x19E, 74 AL_LOCK = 0x19E,
72 AL_CONTROL_PANEL = 0x19F, 75 AL_CONTROL_PANEL = 0x19F,
73 AL_ASSISTANT = 0x1CB, 76 AL_ASSISTANT = 0x1CB,
77 AL_KEYBOARD_LAYOUT = 0x1AE,
74 // 15.16 Generic GUI Application Controls 78 // 15.16 Generic GUI Application Controls
75 AC_MINIMIZE = 0x206, 79 AC_MINIMIZE = 0x206,
76 AC_SEARCH = 0x221, 80 AC_SEARCH = 0x221,
@@ -186,6 +190,16 @@ typedef struct {
186 int8_t h; 190 int8_t h;
187} __attribute__((packed)) report_mouse_t; 191} __attribute__((packed)) report_mouse_t;
188 192
193typedef struct {
194#if JOYSTICK_AXES_COUNT > 0
195 int8_t axes[JOYSTICK_AXES_COUNT];
196#endif
197
198#if JOYSTICK_BUTTON_COUNT > 0
199 uint8_t buttons[(JOYSTICK_BUTTON_COUNT - 1) / 8 + 1];
200#endif
201} __attribute__((packed)) joystick_report_t;
202
189/* keycode to system usage */ 203/* keycode to system usage */
190static inline uint16_t KEYCODE2SYSTEM(uint8_t key) { 204static inline uint16_t KEYCODE2SYSTEM(uint8_t key) {
191 switch (key) { 205 switch (key) {