From 711658206f86fc6af35be7d104243dfcf857f194 Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Tue, 3 Nov 2020 16:55:34 +0000 Subject: [PATCH] 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. --- app/include/zmk/hid.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/app/include/zmk/hid.h b/app/include/zmk/hid.h index 2426c2db..61b2d649 100644 --- a/app/include/zmk/hid.h +++ b/app/include/zmk/hid.h @@ -10,6 +10,8 @@ #include #include +#include +#include #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,