Skip to content

Commit

Permalink
work around macOS bug
Browse files Browse the repository at this point in the history
As it turns out, macOS's HID report descriptor parser is not up to spec.
HID 1.11 quote, chapter 6.2.2.8:
Interpretation of Usage, Usage Minimum or Usage Maximum items vary as a
function of the item’s bSize field. If the bSize field = 3 then the item is
interpreted as a 32 bit unsigned value where the high order 16 bits defines the
Usage Page and the low order 16 bits defines the Usage ID. 32 bit usage items
that define both the Usage Page and Usage ID are often referred to as
“Extended” Usages.

The previous report descriptor was recognized correctly by Windows, Linux,
Android at least, but not by macOS.
  • Loading branch information
benedekkupper committed Apr 4, 2024
1 parent d2b79e5 commit 11a6e8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hid-rp/hid/app/keyboard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ static constexpr auto app_report_descriptor()

// clang-format off
return descriptor(
usage_extended(generic_desktop::KEYBOARD),
usage_page<generic_desktop>(),
usage(generic_desktop::KEYBOARD),
collection::application(
// input keys report
keys_input_report_descriptor<REPORT_ID>(),
Expand Down

0 comments on commit 11a6e8a

Please sign in to comment.