-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSX joystick enumeration changes #662
base: master
Are you sure you want to change the base?
Conversation
…e robust. The current implementation assumes each HID device is one controller/joystick. The patch fixes this by interpreting each collection reported by the device as a separate controller/joystick (this is part of the USB HID spec). The names of the various elements are generated from the data reported by the HID device. (cherry picked from commit 0828211)
…e robust. The current implementation assumes each HID device is one controller/joystick. The patch fixes this by interpreting each collection reported by the device as a separate controller/joystick (this is part of the USB HID spec). The names of the various elements are generated from the data reported by the HID device.
Does the bug only affect OS X/macOS? I'm using an Xbox One controller on Windows with Allegro 5.2.1 and it seems to work fine. |
This is a re-introduction of the change that got reverted, so there's no bug per se. But either way, yes, it only affected OSX. |
What needs to be done here? I recall some joysticks worked better with this code than the reverted code... what was it that did/didn't work then/now? I might have a joystick somewhere that exhibits the problems. |
Here's the conversation that caused the reversion: 0828211 It appeared that XBox controller didn't work for you with this patch :). |
I've since noticed that even Windows messes up my joysticks. I'll have a trigger where an axis is supposed to be etc. Right now all I have is Xbox and a Logitech F710 (which is like an Xbox but has a directinput mode too) and a couple bluetooth controllers. I'll take a look how they work across platforms but it'll probably be next week. |
Don't know if this is your issue, but I vaguely recall that Windows normally treats the L and R triggers on an Xbox controller as a single axis. Each trigger cancels out the other so that it's impossible to tell if both are pressed simultaneously. |
The issue I had was the right stick showed up as a trigger plus one axis of a stick. |
I had a look at this. I can't do a whole lot because I don't have any of the type of joysticks that Todd Cope was using (with multiple joysticks on one device.) I dunno if it's correct but I have a hunch we need to check the Collection type when enumerating elements and not use all collections. I made some changes to this pull request here: https://github.com/goobliata/allegro5/tree/osx_joysticks. I found if I check for Application collections (Logical collections works as well) it'll work with my gamepads. The buttons are ordered oddly though, so I also sort them by usage which gives the same layout as before Todd's patch. Anyway, not sure this is much use unless someone can test/fix it with one of those Wii U controllers or something similar. |
I tested the version of the patch located here: https://github.com/goobliata/allegro5/tree/osx_joysticks. It is working perfectly with my Mayflash Wii U Pro Controller adapter. Each controller is detected as a separate joystick in Allegro as expected. |
This is a revival of the currently reverted OSX changes, so we don't forget about them. There's some issue with the XBox controllers.
(cherry picked from commit 0828211)