diff options
author | Ryan <fauxpark@gmail.com> | 2020-03-21 16:19:15 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-21 16:19:15 +1100 |
commit | 7e80686f1e400010a8a800cc73c4896936f337de (patch) | |
tree | e302f7270c2ac702f2814eeddf6f835990b55299 | |
parent | e967471c4f955cee02c9d459e92e6ffd7844b481 (diff) | |
download | qmk_firmware-7e80686f1e400010a8a800cc73c4896936f337de.tar.gz qmk_firmware-7e80686f1e400010a8a800cc73c4896936f337de.zip |
Tidy up report.h (#8486)
* Tidy up report.h
* Add link to Review Request 41 for brightness controls
-rw-r--r-- | tmk_core/common/report.h | 121 |
1 files changed, 68 insertions, 53 deletions
diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h index b7d104a45..af91718bd 100644 --- a/tmk_core/common/report.h +++ b/tmk_core/common/report.h | |||
@@ -15,66 +15,83 @@ You should have received a copy of the GNU General Public License | |||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #ifndef REPORT_H | 18 | #pragma once |
19 | #define REPORT_H | ||
20 | 19 | ||
21 | #include <stdint.h> | 20 | #include <stdint.h> |
22 | #include <stdbool.h> | 21 | #include <stdbool.h> |
23 | #include "keycode.h" | 22 | #include "keycode.h" |
24 | 23 | ||
25 | /* report id */ | 24 | /* HID report IDs */ |
26 | #define REPORT_ID_KEYBOARD 1 | 25 | enum hid_report_ids { |
27 | #define REPORT_ID_MOUSE 2 | 26 | REPORT_ID_KEYBOARD = 1, |
28 | #define REPORT_ID_SYSTEM 3 | 27 | REPORT_ID_MOUSE, |
29 | #define REPORT_ID_CONSUMER 4 | 28 | REPORT_ID_SYSTEM, |
30 | #define REPORT_ID_NKRO 5 | 29 | REPORT_ID_CONSUMER, |
30 | REPORT_ID_NKRO | ||
31 | }; | ||
31 | 32 | ||
32 | /* mouse buttons */ | 33 | /* Mouse buttons */ |
33 | #define MOUSE_BTN1 (1 << 0) | 34 | enum mouse_buttons { |
34 | #define MOUSE_BTN2 (1 << 1) | 35 | MOUSE_BTN1 = (1 << 0), |
35 | #define MOUSE_BTN3 (1 << 2) | 36 | MOUSE_BTN2 = (1 << 1), |
36 | #define MOUSE_BTN4 (1 << 3) | 37 | MOUSE_BTN3 = (1 << 2), |
37 | #define MOUSE_BTN5 (1 << 4) | 38 | MOUSE_BTN4 = (1 << 3), |
39 | MOUSE_BTN5 = (1 << 4) | ||
40 | }; | ||
38 | 41 | ||
39 | /* Consumer Page(0x0C) | 42 | // clang-format off |
40 | * following are supported by Windows: http://msdn.microsoft.com/en-us/windows/hardware/gg463372.aspx | 43 | |
41 | * see also https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/display-brightness-control | 44 | /* Consumer Page (0x0C) |
45 | * | ||
46 | * See https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf#page=75 | ||
42 | */ | 47 | */ |
43 | #define AUDIO_MUTE 0x00E2 | 48 | enum consumer_usages { |
44 | #define AUDIO_VOL_UP 0x00E9 | 49 | // 15.5 Display Controls (https://www.usb.org/sites/default/files/hutrr41_0.pdf) |
45 | #define AUDIO_VOL_DOWN 0x00EA | 50 | BRIGHTNESS_UP = 0x06F, |
46 | #define TRANSPORT_NEXT_TRACK 0x00B5 | 51 | BRIGHTNESS_DOWN = 0x070, |
47 | #define TRANSPORT_PREV_TRACK 0x00B6 | 52 | // 15.7 Transport Controls |
48 | #define TRANSPORT_STOP 0x00B7 | 53 | TRANSPORT_RECORD = 0x0B2, |
49 | #define TRANSPORT_STOP_EJECT 0x00CC | 54 | TRANSPORT_FAST_FORWARD = 0x0B3, |
50 | #define TRANSPORT_PLAY_PAUSE 0x00CD | 55 | TRANSPORT_REWIND = 0x0B4, |
51 | #define BRIGHTNESS_UP 0x006F | 56 | TRANSPORT_NEXT_TRACK = 0x0B5, |
52 | #define BRIGHTNESS_DOWN 0x0070 | 57 | TRANSPORT_PREV_TRACK = 0x0B6, |
53 | /* application launch */ | 58 | TRANSPORT_STOP = 0x0B7, |
54 | #define AL_CC_CONFIG 0x0183 | 59 | TRANSPORT_EJECT = 0x0B8, |
55 | #define AL_EMAIL 0x018A | 60 | TRANSPORT_STOP_EJECT = 0x0CC, |
56 | #define AL_CALCULATOR 0x0192 | 61 | TRANSPORT_PLAY_PAUSE = 0x0CD, |
57 | #define AL_LOCAL_BROWSER 0x0194 | 62 | // 15.9.1 Audio Controls - Volume |
58 | /* application control */ | 63 | AUDIO_MUTE = 0x0E2, |
59 | #define AC_SEARCH 0x0221 | 64 | AUDIO_VOL_UP = 0x0E9, |
60 | #define AC_HOME 0x0223 | 65 | AUDIO_VOL_DOWN = 0x0EA, |
61 | #define AC_BACK 0x0224 | 66 | // 15.15 Application Launch Buttons |
62 | #define AC_FORWARD 0x0225 | 67 | AL_CC_CONFIG = 0x183, |
63 | #define AC_STOP 0x0226 | 68 | AL_EMAIL = 0x18A, |
64 | #define AC_REFRESH 0x0227 | 69 | AL_CALCULATOR = 0x192, |
65 | #define AC_BOOKMARKS 0x022A | 70 | AL_LOCAL_BROWSER = 0x194, |
66 | /* supplement for Bluegiga iWRAP HID(not supported by Windows?) */ | 71 | AL_LOCK = 0x19E, |
67 | #define AL_LOCK 0x019E | 72 | // 15.16 Generic GUI Application Controls |
68 | #define TRANSPORT_RECORD 0x00B2 | 73 | AC_MINIMIZE = 0x206, |
69 | #define TRANSPORT_FAST_FORWARD 0x00B3 | 74 | AC_SEARCH = 0x221, |
70 | #define TRANSPORT_REWIND 0x00B4 | 75 | AC_HOME = 0x223, |
71 | #define TRANSPORT_EJECT 0x00B8 | 76 | AC_BACK = 0x224, |
72 | #define AC_MINIMIZE 0x0206 | 77 | AC_FORWARD = 0x225, |
78 | AC_STOP = 0x226, | ||
79 | AC_REFRESH = 0x227, | ||
80 | AC_BOOKMARKS = 0x22A | ||
81 | }; | ||
73 | 82 | ||
74 | /* Generic Desktop Page(0x01) - system power control */ | 83 | /* Generic Desktop Page (0x01) |
75 | #define SYSTEM_POWER_DOWN 0x0081 | 84 | * |
76 | #define SYSTEM_SLEEP 0x0082 | 85 | * See https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf#page=26 |
77 | #define SYSTEM_WAKE_UP 0x0083 | 86 | */ |
87 | enum desktop_usages { | ||
88 | // 4.5.1 System Controls - Power Controls | ||
89 | SYSTEM_POWER_DOWN = 0x81, | ||
90 | SYSTEM_SLEEP = 0x82, | ||
91 | SYSTEM_WAKE_UP = 0x83 | ||
92 | }; | ||
93 | |||
94 | // clang-format on | ||
78 | 95 | ||
79 | #define NKRO_SHARED_EP | 96 | #define NKRO_SHARED_EP |
80 | /* key report size(NKRO or boot mode) */ | 97 | /* key report size(NKRO or boot mode) */ |
@@ -253,5 +270,3 @@ void clear_keys_from_report(report_keyboard_t* keyboard_report); | |||
253 | #ifdef __cplusplus | 270 | #ifdef __cplusplus |
254 | } | 271 | } |
255 | #endif | 272 | #endif |
256 | |||
257 | #endif | ||