-
Notifications
You must be signed in to change notification settings - Fork 294
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
Implement al_get_joystick_name()
on MacOS.
#1448
Conversation
This was a long time ago but I think
0828211
was not reverted accidentally, it was because of a problem reported by
Trent (see comments at the bottom)
That PR also had a change to the code to get the element names from MacOS
(`get_element_name`) - looking at it now there may be a more robust way of
doing it (analogous to the way `get_joystick_name` works in this PR)
… Message ID: ***@***.***>
|
Yeah, I had forgotten about that original PR and that a modified version of it was still hanging out here. That was 7 years ago. The project I was needing to fix the code for got put on hold. Now I'm trying to add joystick support to one of my current projects and thought I would just fix Joystick code in general is a mess since all the manufactures can't seem to follow the HID spec correctly. I didn't realize how bad it was since I wasn't trying to do autodetection back then. I fired up Apparently, the standard way to handle joysticks is to just assume people are using XBox 360 or compatible controllers and handling the axis/button configuration based on that assumption. Should I go back to 0828211 to see if I can make that work? I still have the device that wasn't working properly back then and have added quite a few others that I can test with. |
Thanks.
I'd love to have a system that detects XBox-like controllers and works across OSs. As it is now, I don't think this happens, e.g. my Logitech F310 splits its left thumbstick into two sticks. |
Unfortunately, the only way to get something that resembles detection is to keep a database of joysticks and have a remapping system. I ended up implementing a remapping system into my own framework that sits on top of Allegro. The one thing that Allegro lacks is a way to get the joystick device identifier (vendor/product). If it had that, I would be able to support more joysticks with my remapping system. It looks like some work on this is already being done: #1426. Currently, I'm just assuming controllers are XBox and allowing the user to remap if it is incorrect. |
Thanks for the merge @SiegeLord. @NewCreature What types of name values can we expect from the
Thanks for this assumption, it happens to work for me. Also, thank you for mentioning #1426, if you wish to work on it and move it forward that would be great 🙏. I'll help if I have bandwidth. |
As for #1426, I would be happy to help with it if needed. What work is left to be done there? |
That's not what I meant. What I mean is, I am certain that XBox-like controllers all look the same to each OS, and Allegro should provide the same mapping across OS's. This is not the case right now. |
This commit implements retrieving the name of joystick devices on MacOS. This was implemented in a previous commit (0828211) and was apparently accidentally reverted in a subsequent commit (e18a22b).
I plan to go back over the original commit to see if any other changes from that commit need to be re-implemented.