Commit 001b7077 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winebus.sys: Add some buttons to HID keyboard input report.

parent 318e5fed
...@@ -33,7 +33,7 @@ static const BYTE REPORT_HEADER[] = { ...@@ -33,7 +33,7 @@ static const BYTE REPORT_HEADER[] = {
#define IDX_HEADER_USAGE 3 #define IDX_HEADER_USAGE 3
static const BYTE REPORT_BUTTONS[] = { static const BYTE REPORT_BUTTONS[] = {
USAGE_PAGE(1, HID_USAGE_PAGE_BUTTON), USAGE_PAGE(1, /* placeholder */ HID_USAGE_PAGE_BUTTON),
USAGE_MINIMUM(1, /* placeholder */ 1), USAGE_MINIMUM(1, /* placeholder */ 1),
USAGE_MAXIMUM(1, /* placeholder */ 3), USAGE_MAXIMUM(1, /* placeholder */ 3),
LOGICAL_MINIMUM(1, 0), LOGICAL_MINIMUM(1, 0),
...@@ -44,6 +44,7 @@ static const BYTE REPORT_BUTTONS[] = { ...@@ -44,6 +44,7 @@ static const BYTE REPORT_BUTTONS[] = {
REPORT_SIZE(1, 1), REPORT_SIZE(1, 1),
INPUT(1, Data|Var|Abs), INPUT(1, Data|Var|Abs),
}; };
#define IDX_BUTTON_USAGE_PAGE 1
#define IDX_BUTTON_MIN_USAGE 3 #define IDX_BUTTON_MIN_USAGE 3
#define IDX_BUTTON_MAX_USAGE 5 #define IDX_BUTTON_MAX_USAGE 5
#define IDX_BUTTON_COUNT 15 #define IDX_BUTTON_COUNT 15
......
...@@ -546,12 +546,14 @@ static NTSTATUS keyboard_get_reportdescriptor(DEVICE_OBJECT *device, BYTE *buffe ...@@ -546,12 +546,14 @@ static NTSTATUS keyboard_get_reportdescriptor(DEVICE_OBJECT *device, BYTE *buffe
{ {
TRACE("buffer %p, length %u.\n", buffer, length); TRACE("buffer %p, length %u.\n", buffer, length);
*ret_length = sizeof(REPORT_HEADER) + sizeof(REPORT_TAIL); *ret_length = sizeof(REPORT_HEADER) + sizeof(REPORT_BUTTONS) + sizeof(REPORT_TAIL);
if (length < sizeof(REPORT_HEADER) + sizeof(REPORT_TAIL)) if (length < sizeof(REPORT_HEADER) + sizeof(REPORT_BUTTONS) + sizeof(REPORT_TAIL))
return STATUS_BUFFER_TOO_SMALL; return STATUS_BUFFER_TOO_SMALL;
memcpy(buffer, REPORT_HEADER, sizeof(REPORT_HEADER)); memcpy(buffer, REPORT_HEADER, sizeof(REPORT_HEADER));
memcpy(buffer + sizeof(REPORT_HEADER), REPORT_TAIL, sizeof(REPORT_TAIL)); add_button_block(buffer + sizeof(REPORT_HEADER), 0, 101);
buffer[sizeof(REPORT_HEADER) + IDX_BUTTON_USAGE_PAGE] = HID_USAGE_PAGE_KEYBOARD;
memcpy(buffer + sizeof(REPORT_HEADER) + sizeof(REPORT_BUTTONS), REPORT_TAIL, sizeof(REPORT_TAIL));
buffer[IDX_HEADER_PAGE] = HID_USAGE_PAGE_GENERIC; buffer[IDX_HEADER_PAGE] = HID_USAGE_PAGE_GENERIC;
buffer[IDX_HEADER_USAGE] = HID_USAGE_GENERIC_KEYBOARD; buffer[IDX_HEADER_USAGE] = HID_USAGE_GENERIC_KEYBOARD;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment