Skip to content

[osx] Unexpected behavior for right stick of modern Xbox controller #1462

@connorjclark

Description

@connorjclark

Xbox Wireless Controller

This controller has three sticks: 0 and 1 are the left and right sticks, and 2 is the DPAD (hat switch).

According to the allegro joystick interface on OSX, these switches have these number of axis:

Stick 0 has 3 axis (kHIDUsage_GD_X, kHIDUsage_GD_Y, kHIDUsage_GD_Y)
Stick 1 has 1 axis (kHIDUsage_GD_Rz)
Stick 2 has 2 axis (the hat switch)

I noticed that when processing stick 1 in static void add_elements, two HID usage interfaces are ignored with decimal values 196 and 197. These values are not defined in the HID header.

Listing the odd things:

  • Why does Stick 0 have 3 axis instead of 2? I know it's a totally different stack, but https://hardwaretester.com/gamepad only lists two axis for both Stick 0 and 1.
  • Why don't Sticks 0 and 1, which are identical physical controls, have an identical number of axis?
  • What are usages 196 and 197? Did this Xbox controller make up their own usage ids?
  • When moving the right stick (Stick 1) to the right, I get a mix of events for Stick 1, and for Stick 0 Axis 2, which is super broken. When moving that right stick Up I don't get any events from Stick 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions