refactor(hid): Replace Zephyr usages with ZMK usages in HID reports
Replace `USAGE_GEN_DESKTOP` with `HID_USAGE_GD`. Replace `USAGE_GEN_DESKTOP_KEYBOARD` with `HID_USAGE_GD_KEYBOARD`. Replace `USAGE_GEN_DESKTOP_KEYPAD` with `HID_USAGE_KEY`. Replace `0x0C` with `HID_USAGE_CONSUMER`. Closes #217.
This commit is contained in:
parent
e925319e4c
commit
711658206f
1 changed files with 12 additions and 10 deletions
|
@ -10,6 +10,8 @@
|
|||
#include <usb/class/usb_hid.h>
|
||||
|
||||
#include <zmk/keys.h>
|
||||
#include <dt-bindings/zmk/hid_usage.h>
|
||||
#include <dt-bindings/zmk/hid_usage_pages.h>
|
||||
|
||||
#define COLLECTION_REPORT 0x03
|
||||
|
||||
|
@ -20,19 +22,19 @@
|
|||
static const u8_t zmk_hid_report_desc[] = {
|
||||
/* USAGE_PAGE (Generic Desktop) */
|
||||
HID_GI_USAGE_PAGE,
|
||||
USAGE_GEN_DESKTOP,
|
||||
HID_USAGE_GD,
|
||||
/* USAGE (Keyboard) */
|
||||
HID_LI_USAGE,
|
||||
USAGE_GEN_DESKTOP_KEYBOARD,
|
||||
HID_USAGE_GD_KEYBOARD,
|
||||
/* COLLECTION (Application) */
|
||||
HID_MI_COLLECTION,
|
||||
COLLECTION_APPLICATION,
|
||||
/* REPORT ID (1) */
|
||||
HID_GI_REPORT_ID,
|
||||
0x01,
|
||||
/* USAGE_PAGE (Keypad) */
|
||||
/* USAGE_PAGE (Keyboard/Keypad) */
|
||||
HID_GI_USAGE_PAGE,
|
||||
USAGE_GEN_DESKTOP_KEYPAD,
|
||||
HID_USAGE_KEY,
|
||||
/* USAGE_MINIMUM (Keyboard LeftControl) */
|
||||
HID_LI_USAGE_MIN(1),
|
||||
0xE0,
|
||||
|
@ -56,9 +58,9 @@ static const u8_t zmk_hid_report_desc[] = {
|
|||
HID_MI_INPUT,
|
||||
0x02,
|
||||
|
||||
/* USAGE_PAGE (Keypad) */
|
||||
/* USAGE_PAGE (Keyboard/Keypad) */
|
||||
HID_GI_USAGE_PAGE,
|
||||
USAGE_GEN_DESKTOP_KEYPAD,
|
||||
HID_USAGE_KEY,
|
||||
/* REPORT_SIZE (8) */
|
||||
HID_GI_REPORT_SIZE,
|
||||
0x08,
|
||||
|
@ -69,9 +71,9 @@ static const u8_t zmk_hid_report_desc[] = {
|
|||
HID_MI_INPUT,
|
||||
0x03,
|
||||
|
||||
/* USAGE_PAGE (Keypad) */
|
||||
/* USAGE_PAGE (Keyboard/Keypad) */
|
||||
HID_GI_USAGE_PAGE,
|
||||
USAGE_GEN_DESKTOP_KEYPAD,
|
||||
HID_USAGE_KEY,
|
||||
/* LOGICAL_MINIMUM (0) */
|
||||
HID_GI_LOGICAL_MIN(1),
|
||||
0x00,
|
||||
|
@ -98,7 +100,7 @@ static const u8_t zmk_hid_report_desc[] = {
|
|||
HID_MI_COLLECTION_END,
|
||||
/* USAGE_PAGE (Consumer) */
|
||||
HID_GI_USAGE_PAGE,
|
||||
0x0C,
|
||||
HID_USAGE_CONSUMER,
|
||||
/* USAGE (Consumer Control) */
|
||||
HID_LI_USAGE,
|
||||
0x01,
|
||||
|
@ -110,7 +112,7 @@ static const u8_t zmk_hid_report_desc[] = {
|
|||
0x02,
|
||||
/* USAGE_PAGE (Consumer) */
|
||||
HID_GI_USAGE_PAGE,
|
||||
0x0C,
|
||||
HID_USAGE_CONSUMER,
|
||||
/* LOGICAL_MINIMUM (0) */
|
||||
HID_GI_LOGICAL_MIN(1),
|
||||
0x00,
|
||||
|
|
Loading…
Reference in a new issue