[idd] input: preserve reports under backpressure

Move named pipe writes off the LGMP input worker so a stalled LGInput
endpoint cannot block queue draining or lease maintenance.

Coalesce motion only under queue pressure while preserving mode, button,
wheel, and keyboard transitions. Reset HID state after discontinuities
and carry all 32 mouse button bits through the pipe and HID reports.
This commit is contained in:
Geoffrey McRae
2026-08-08 23:31:44 +10:00
parent 83c552fb9d
commit ced2fb531e
16 changed files with 820 additions and 382 deletions

View File

@@ -35,7 +35,7 @@ enum HIDReportId : uint8_t
struct HIDMouseAbsoluteReport
{
uint8_t reportId;
uint8_t buttons;
uint32_t buttons;
uint16_t x;
uint16_t y;
int8_t wheel;
@@ -44,7 +44,7 @@ struct HIDMouseAbsoluteReport
struct HIDMouseRelativeReport
{
uint8_t reportId;
uint8_t buttons;
uint32_t buttons;
int16_t x;
int16_t y;
int8_t wheel;
@@ -66,11 +66,14 @@ struct HIDKeyboardLedsReport
#pragma pack(pop)
static_assert(sizeof(HIDMouseAbsoluteReport) == 7);
static_assert(sizeof(HIDMouseRelativeReport) == 7);
static_assert(sizeof(HIDMouseAbsoluteReport) == 10);
static_assert(sizeof(HIDMouseRelativeReport) == 10);
static_assert(sizeof(HIDKeyboardReport) == 9);
static_assert(sizeof(HIDKeyboardLedsReport) == 2);
static constexpr size_t HID_MAX_INPUT_REPORT_SIZE =
sizeof(HIDMouseAbsoluteReport);
const uint8_t * HIDGetReportDescriptor();
size_t HIDGetReportDescriptorSize();
size_t HIDGetInputReportSize(uint8_t reportId);