[idd] input: report volume keys as consumer controls

Expose a Consumer Control HID report for the system volume usages that
Windows does not handle through the Keyboard/Keypad usage page.

Translate the existing mute and volume keyboard usages at the LGInput
boundary, preserve normal keyboard state, and force a neutral consumer
report across resets and HID device reactivation.
This commit is contained in:
Geoffrey McRae
2026-08-09 01:02:33 +10:00
parent ced2fb531e
commit 726086a969
5 changed files with 90 additions and 6 deletions

View File

@@ -28,6 +28,7 @@ enum HIDReportId : uint8_t
HID_REPORT_ID_MOUSE_ABSOLUTE = 1,
HID_REPORT_ID_MOUSE_RELATIVE = 2,
HID_REPORT_ID_KEYBOARD = 3,
HID_REPORT_ID_CONSUMER = 4,
};
#pragma pack(push, 1)
@@ -64,12 +65,19 @@ struct HIDKeyboardLedsReport
uint8_t leds;
};
struct HIDConsumerReport
{
uint8_t reportId;
uint16_t usage;
};
#pragma pack(pop)
static_assert(sizeof(HIDMouseAbsoluteReport) == 10);
static_assert(sizeof(HIDMouseRelativeReport) == 10);
static_assert(sizeof(HIDKeyboardReport) == 9);
static_assert(sizeof(HIDKeyboardLedsReport) == 2);
static_assert(sizeof(HIDConsumerReport) == 3);
static constexpr size_t HID_MAX_INPUT_REPORT_SIZE =
sizeof(HIDMouseAbsoluteReport);