After investigating our implementation in `CocoaGamepad.cpp`, we should add an another type for `kMultiAxisUsage: 0x08`[1], but it still doesn't work for Xbox controllers, I can't get its `DeviceAddedCallback`. It looks like Xbox gamepads in MacOS are no longer to be able to use `IOHIDDevice` to query devices. We need to consider to register `IOService` and use `IOServiceAddMatchingNotification` [1] to listen new devices be added. [1] https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/dom/gamepad/cocoa/CocoaGamepad.cpp#508 [1] https://developer.apple.com/documentation/iokit/1514362-ioserviceaddmatchingnotification?language=objc
Bug 1609068 Comment 5 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
After investigating our implementation in `CocoaGamepad.cpp`, we should add an another type for `kMultiAxisUsage: 0x08`[1], but it still doesn't work for Xbox controllers, I can't get its `DeviceAddedCallback`. It looks like Xbox gamepads in MacOS are no longer to be able to use `IOHIDDevice` to query devices. We need to consider to register `IOService` and use `IOServiceAddMatchingNotification` [2] to listen new devices be added. [1] https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/dom/gamepad/cocoa/CocoaGamepad.cpp#508 [1] https://developer.apple.com/documentation/iokit/1514362-ioserviceaddmatchingnotification?language=objc
After investigating our implementation in `CocoaGamepad.cpp`, we should add an another type for `kMultiAxisUsage: 0x08`[1], but it still doesn't work for Xbox controllers, I can't get its `DeviceAddedCallback`. It looks like Xbox gamepads in MacOS are no longer to be able to use `IOHIDDevice` to query devices. We need to consider to register `IOService` and use `IOServiceAddMatchingNotification` [2] to listen new devices be added. [1] https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/dom/gamepad/cocoa/CocoaGamepad.cpp#508 [2] https://developer.apple.com/documentation/iokit/1514362-ioserviceaddmatchingnotification?language=objc