Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SiegeLord
Copy link
Member

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)

…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)
SiegeLord referenced this pull request Aug 14, 2016
…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.
@fatcerberus
Copy link
Contributor

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.

@SiegeLord
Copy link
Member Author

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.

@ghost
Copy link

ghost commented Mar 27, 2017

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.

@SiegeLord
Copy link
Member Author

Here's the conversation that caused the reversion: 0828211 It appeared that XBox controller didn't work for you with this patch :).

@ghost
Copy link

ghost commented May 22, 2017

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.

@fatcerberus
Copy link
Contributor

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.

@ghost
Copy link

ghost commented May 22, 2017

The issue I had was the right stick showed up as a trigger plus one axis of a stick.

@ghost
Copy link

ghost commented May 28, 2017

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.

@NewCreature
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants