From e10060f7ee3f34f5049e7c24642f1efb8e6953f9 Mon Sep 17 00:00:00 2001 From: Benedek Kupper Date: Mon, 1 Jun 2026 22:07:41 +0200 Subject: [PATCH] uhk60: fix LED report filtering when report IDs aren't used --- right/src/hid/keyboard_app.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/right/src/hid/keyboard_app.cpp b/right/src/hid/keyboard_app.cpp index a4ed708a3..65fea5bea 100644 --- a/right/src/hid/keyboard_app.cpp +++ b/right/src/hid/keyboard_app.cpp @@ -111,7 +111,8 @@ std::span keyboard_app::move_to_buffer(const hid_keyboard_report_ auto &keys_nkro = keys_[buf_idx].nkro; ::memcpy(&keys_nkro.modifiers, &report.modifiers, sizeof(report.modifiers)); - ::memcpy(static_cast(&keys_nkro.scancodes), &report.bitfield, sizeof(report.bitfield)); + ::memcpy( + static_cast(&keys_nkro.scancodes), &report.bitfield, sizeof(report.bitfield)); return std::span( reinterpret_cast(&keys_nkro), sizeof(keys_nkro)); @@ -157,8 +158,11 @@ keyboard_app::leds_boot_report keyboard_app::get_leds() const void keyboard_app::set_report(hid::report::type type, const std::span &data) { - if ((prot_ == hid::protocol::REPORT) && - ((type != hid::report::type::OUTPUT) || (data.front() != LEDS_REPORT_ID))) { + if (type != hid::report::type::OUTPUT) { + return; + } + if ((prot_ == hid::protocol::REPORT) && (LEDS_REPORT_ID != 0) && + (data.front() != LEDS_REPORT_ID)) { return; } // only one report is receivable, the LEDs