|
|
|
@ -7,7 +7,8 @@
@@ -7,7 +7,8 @@
|
|
|
|
|
#pragma once |
|
|
|
|
|
|
|
|
|
#include <usb/usb_device.h> |
|
|
|
|
#include <usb/class/usb_hid.h> |
|
|
|
|
//#include <usb/class/usb_hid.h>
|
|
|
|
|
#include <usb/class/hid.h> |
|
|
|
|
|
|
|
|
|
#include <zmk/keys.h> |
|
|
|
|
#include <zmk/mouse.h> |
|
|
|
@ -85,122 +86,86 @@ static const uint8_t zmk_hid_report_desc[] = {
@@ -85,122 +86,86 @@ static const uint8_t zmk_hid_report_desc[] = {
|
|
|
|
|
#error "A proper consumer HID report usage range must be selected" |
|
|
|
|
#endif |
|
|
|
|
/* REPORT_COUNT (CONFIG_ZMK_HID_CONSUMER_REPORT_SIZE) */ |
|
|
|
|
HID_GI_REPORT_COUNT, |
|
|
|
|
CONFIG_ZMK_HID_CONSUMER_REPORT_SIZE, |
|
|
|
|
HID_MI_INPUT, |
|
|
|
|
HID_REPORT_COUNT(CONFIG_ZMK_HID_CONSUMER_REPORT_SIZE), |
|
|
|
|
HID_INPUT(0x00), |
|
|
|
|
0x00, |
|
|
|
|
/* END COLLECTION */ |
|
|
|
|
HID_MI_COLLECTION_END, |
|
|
|
|
HID_END_COLLECTION, |
|
|
|
|
|
|
|
|
|
/* USAGE_PAGE (Generic Desktop) */ |
|
|
|
|
HID_GI_USAGE_PAGE, |
|
|
|
|
HID_USAGE_GD, |
|
|
|
|
HID_USAGE_PAGE(HID_USAGE_GD), |
|
|
|
|
/* USAGE (Mouse) */ |
|
|
|
|
HID_LI_USAGE, |
|
|
|
|
HID_USAGE_GD_MOUSE, |
|
|
|
|
HID_USAGE(HID_USAGE_GD_MOUSE), |
|
|
|
|
/* COLLECTION (Application) */ |
|
|
|
|
HID_MI_COLLECTION, |
|
|
|
|
COLLECTION_APPLICATION, |
|
|
|
|
HID_COLLECTION(HID_COLLECTION_APPLICATION), |
|
|
|
|
/* REPORT ID (4) */ |
|
|
|
|
HID_GI_REPORT_ID, |
|
|
|
|
0x04, |
|
|
|
|
HID_REPORT_ID(0x04), |
|
|
|
|
/* USAGE (Pointer) */ |
|
|
|
|
HID_LI_USAGE, |
|
|
|
|
HID_USAGE_GD_POINTER, |
|
|
|
|
HID_USAGE(HID_USAGE_GD_POINTER), |
|
|
|
|
/* COLLECTION (Physical) */ |
|
|
|
|
HID_MI_COLLECTION, |
|
|
|
|
COLLECTION_PHYSICAL, |
|
|
|
|
HID_COLLECTION(HID_COLLECTION_PHYSICAL), |
|
|
|
|
/* USAGE_PAGE (Button) */ |
|
|
|
|
HID_GI_USAGE_PAGE, |
|
|
|
|
HID_USAGE_BUTTON, |
|
|
|
|
HID_USAGE_PAGE(HID_USAGE_BUTTON), |
|
|
|
|
/* USAGE_MINIMUM (0x1) (button 1?) */ |
|
|
|
|
HID_LI_USAGE_MIN(1), |
|
|
|
|
0x1, |
|
|
|
|
HID_USAGE_MIN8(0x01), |
|
|
|
|
/* USAGE_MAXIMUM (0x10) (button 5? Buttons up to 8 still work) */ |
|
|
|
|
HID_LI_USAGE_MAX(1), |
|
|
|
|
0x10, |
|
|
|
|
HID_USAGE_MAX8(0x10), |
|
|
|
|
/* LOGICAL_MINIMUM (0) */ |
|
|
|
|
HID_GI_LOGICAL_MIN(1), |
|
|
|
|
0x00, |
|
|
|
|
HID_LOGICAL_MIN8(0x00), |
|
|
|
|
/* LOGICAL_MAXIMUM (1) */ |
|
|
|
|
HID_GI_LOGICAL_MAX(1), |
|
|
|
|
0x01, |
|
|
|
|
HID_LOGICAL_MAX8(0x01), |
|
|
|
|
/* REPORT_SIZE (1) */ |
|
|
|
|
HID_GI_REPORT_SIZE, |
|
|
|
|
0x01, |
|
|
|
|
HID_REPORT_SIZE(0x01), |
|
|
|
|
/* REPORT_COUNT (16) */ |
|
|
|
|
HID_GI_REPORT_COUNT, |
|
|
|
|
0x10, |
|
|
|
|
HID_REPORT_COUNT(0x10), |
|
|
|
|
/* INPUT (Data,Var,Abs) */ |
|
|
|
|
HID_MI_INPUT, |
|
|
|
|
0x02, |
|
|
|
|
HID_INPUT(0x02), |
|
|
|
|
/* USAGE_PAGE (Generic Desktop) */ |
|
|
|
|
HID_GI_USAGE_PAGE, |
|
|
|
|
HID_USAGE_GD, |
|
|
|
|
HID_USAGE_PAGE(HID_USAGE_GD), |
|
|
|
|
/* LOGICAL_MINIMUM (-32767) */ |
|
|
|
|
HID_GI_LOGICAL_MIN(2), |
|
|
|
|
0x01, |
|
|
|
|
0x80, |
|
|
|
|
HID_LOGICAL_MIN16(0x01, 0x80), |
|
|
|
|
/* LOGICAL_MAXIMUM (32767) */ |
|
|
|
|
HID_GI_LOGICAL_MAX(2), |
|
|
|
|
0xFF, |
|
|
|
|
0x7F, |
|
|
|
|
HID_LOGICAL_MAX16(0xFF, 0x7F), |
|
|
|
|
/* REPORT_SIZE (16) */ |
|
|
|
|
HID_GI_REPORT_SIZE, |
|
|
|
|
0x10, |
|
|
|
|
HID_REPORT_SIZE(0x10), |
|
|
|
|
/* REPORT_COUNT (2) */ |
|
|
|
|
HID_GI_REPORT_COUNT, |
|
|
|
|
0x02, |
|
|
|
|
HID_REPORT_COUNT(0x02), |
|
|
|
|
/* USAGE (X) */ // Vertical scroll
|
|
|
|
|
HID_LI_USAGE, |
|
|
|
|
HID_USAGE_GD_X, |
|
|
|
|
HID_USAGE(HID_USAGE_GD_X), |
|
|
|
|
/* USAGE (Y) */ |
|
|
|
|
HID_LI_USAGE, |
|
|
|
|
HID_USAGE_GD_Y, |
|
|
|
|
HID_USAGE(HID_USAGE_GD_Y), |
|
|
|
|
/* Input (Data,Var,Rel) */ |
|
|
|
|
HID_MI_INPUT, |
|
|
|
|
0x06, |
|
|
|
|
HID_INPUT(0x06), |
|
|
|
|
/* LOGICAL_MINIMUM (-127) */ |
|
|
|
|
HID_GI_LOGICAL_MIN(1), |
|
|
|
|
0x81, |
|
|
|
|
HID_LOGICAL_MIN8(0x81), |
|
|
|
|
/* LOGICAL_MAXIMUM (127) */ |
|
|
|
|
HID_GI_LOGICAL_MAX(1), |
|
|
|
|
0x7F, |
|
|
|
|
HID_LOGICAL_MAX8(0x7F), |
|
|
|
|
/* REPORT_SIZE (8) */ |
|
|
|
|
HID_GI_REPORT_SIZE, |
|
|
|
|
0x08, |
|
|
|
|
HID_REPORT_SIZE(0x08), |
|
|
|
|
/* REPORT_COUNT (1) */ |
|
|
|
|
HID_GI_REPORT_COUNT, |
|
|
|
|
0x01, |
|
|
|
|
HID_REPORT_COUNT(0x01), |
|
|
|
|
/* USAGE (Wheel) */ |
|
|
|
|
HID_LI_USAGE, |
|
|
|
|
HID_USAGE_GD_WHEEL, |
|
|
|
|
HID_USAGE(HID_USAGE_GD_WHEEL), |
|
|
|
|
/* Input (Data,Var,Rel) */ |
|
|
|
|
HID_MI_INPUT, |
|
|
|
|
0x06, |
|
|
|
|
HID_INPUT(0x06), |
|
|
|
|
/* USAGE_PAGE (Consumer) */ // Horizontal scroll
|
|
|
|
|
HID_GI_USAGE_PAGE, |
|
|
|
|
HID_USAGE_CONSUMER, |
|
|
|
|
HID_USAGE_PAGE(HID_USAGE_CONSUMER), |
|
|
|
|
/* USAGE (AC Pan) */ |
|
|
|
|
0x0A, |
|
|
|
|
0x38, |
|
|
|
|
0x02, |
|
|
|
|
/* LOGICAL_MINIMUM (-127) */ |
|
|
|
|
HID_GI_LOGICAL_MIN(1), |
|
|
|
|
0x81, |
|
|
|
|
HID_LOGICAL_MIN8(0x81), |
|
|
|
|
/* LOGICAL_MAXIMUM (127) */ |
|
|
|
|
HID_GI_LOGICAL_MAX(1), |
|
|
|
|
0x7F, |
|
|
|
|
HID_LOGICAL_MAX8(0x7F), |
|
|
|
|
/* REPORT_COUNT (1) */ |
|
|
|
|
HID_GI_REPORT_COUNT, |
|
|
|
|
0x01, |
|
|
|
|
HID_REPORT_COUNT(0x01), |
|
|
|
|
/* Input (Data,Var,Rel) */ |
|
|
|
|
HID_MI_INPUT, |
|
|
|
|
0x06, |
|
|
|
|
HID_INPUT(0x06), |
|
|
|
|
/* END COLLECTION */ |
|
|
|
|
HID_MI_COLLECTION_END, |
|
|
|
|
HID_END_COLLECTION, |
|
|
|
|
/* END COLLECTION */ |
|
|
|
|
HID_MI_COLLECTION_END, |
|
|
|
|
HID_END_COLLECTION, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// struct zmk_hid_boot_report
|
|
|
|
|