From c402e953f6e9655898cd45af9b120d2a45dd45e0 Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Tue, 27 Oct 2020 17:42:00 +0000 Subject: [PATCH] feat(hid): Make keypad report boot friendly Add missing byte to make keypad report boot friendly. --- app/include/zmk/hid.h | 14 ++++++++++++++ app/src/hid.c | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/include/zmk/hid.h b/app/include/zmk/hid.h index d09ffde4..1ce5cc9b 100644 --- a/app/include/zmk/hid.h +++ b/app/include/zmk/hid.h @@ -56,6 +56,19 @@ static const u8_t zmk_hid_report_desc[] = { HID_MI_INPUT, 0x02, + /* USAGE_PAGE (Keypad) */ + HID_GI_USAGE_PAGE, + USAGE_GEN_DESKTOP_KEYPAD, + /* REPORT_SIZE (8) */ + HID_GI_REPORT_SIZE, + 0x08, + /* REPORT_COUNT (1) */ + HID_GI_REPORT_COUNT, + 0x01, + /* INPUT (Cnst,Var,Abs) */ + HID_MI_INPUT, + 0x03, + /* USAGE_PAGE (Keypad) */ HID_GI_USAGE_PAGE, USAGE_GEN_DESKTOP_KEYPAD, @@ -131,6 +144,7 @@ static const u8_t zmk_hid_report_desc[] = { struct zmk_hid_keypad_report_body { zmk_mod_flags modifiers; + u8_t _reserved; u8_t keys[ZMK_HID_KEYPAD_NKRO_SIZE]; } __packed; diff --git a/app/src/hid.c b/app/src/hid.c index 28efee15..207b1adf 100644 --- a/app/src/hid.c +++ b/app/src/hid.c @@ -9,8 +9,8 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #include -static struct zmk_hid_keypad_report kp_report = {.report_id = 1, - .body = {.modifiers = 0, .keys = {0}}}; +static struct zmk_hid_keypad_report kp_report = { + .report_id = 1, .body = {.modifiers = 0, ._reserved = 0, .keys = {0}}}; static struct zmk_hid_consumer_report consumer_report = {.report_id = 2, .body = {.keys = {0}}};