[haiku-bugs] Re: [Haiku] #16647: Problem with HIDReportItem and padding

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Wed, 09 Dec 2020 16:51:33 -0000

#16647: Problem with HIDReportItem and padding
------------------------------------+-------------------------
  Reporter:  lt_henry               |      Owner:  nobody
      Type:  bug                    |     Status:  new
  Priority:  normal                 |  Milestone:  Unscheduled
 Component:  Drivers/Input/USB-HID  |    Version:  R1/beta2
Resolution:                         |   Keywords:
Blocked By:                         |   Blocking:
  Platform:  All                    |
------------------------------------+-------------------------
Comment (by pulkomandy):

 So I looked into the HID spec
 (https://usb.org/sites/default/files/hid1_11.pdf):

Because button bitmaps and arrays can represent multiple buttons or
 switches with a single item, it may be useful to assign multiple usages to
 a Main item. **Usage Minimum specifies the usage to be associated with the
 first unassociated control** in the array or bitmap. Usage Maximum
 specifies the end of the range of usage values to be associated with item
 elements. The following example illustrates how this could be used for a
 105-key keyboard.

 So, yes, it seems multiple minimum/maximum ranges can be specified and
 they will "consume" the corresponding number of buttons.

 But our code does not seem to do this here: https://git.haiku-
 os.org/haiku/tree/src/add-
 ons/kernel/drivers/input/usb_hid/HIDParser.cpp#n313

 It seems we need to store more than just a single minimum and maximum in
 the "local state", so that each range defined by a minimum/maximum adds
 itself to the state, instead of replacing the previous defined ranges. And
 then adjust HIDCollection to handle such states properly.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/16647#comment:6>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: