Skip to content

[cocoa] Support dpad/POV hat switch [e.g. directional buttons on DualShock] #190

Description

@nickolay

This seems to be a known limitation (mentioned in the commit introducing the DS4 buttonmap), but hard to find, unless you know the right terms or take a deep dive into the code.

These are reported as:

  • IOHIDElementGetUsagePage(..) = GENERIC_DESKTOP_USAGE_PAGE (0x01)
  • IOHIDElementGetUsage(..) = 0x39
  • IOHIDValueGetIntegerValue(..) ranging from 0 to 7 indicating eight possible directions and an out-of-range (8 for DS4) value for the unpressed state (as explained here).

...and should end up calling CJoystick::SetHatValue.

One can look into https://bugzilla.mozilla.org/show_bug.cgi?id=1107801 for implementation inspiration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions