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

Expose Additional Joystick Information #1426

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MarkOates
Copy link
Contributor

@MarkOates MarkOates commented Mar 23, 2023

This PR is WIP

Premise

I'd like to add the following:

  • int al_get_joystick_device_id(ALLEGRO_JOYSTICK*)
  • int al_get_joystick_vendor_id(ALLEGRO_JOYSTICK*)
  • const char *al_get_joystick_serial_number(ALLEGRO_JOYSTICK*)

For reasons mentioned in this issue. Specifically, detecting reconnecting joysticks.

Also, having the device_id and vendor_id would provide the minimum features needed to then support customized joystick mapping and "real names" of known joysticks, e.g. "XBox Wireless (Connected)", "DualShock (Connected)", etc.

In the past, there were some mixed proposals for those features, but it seems these discussions have become stale and the designs never solidified. Instead, I propose just these 3 functions, in effect adding the minimum to support those features. Extending that with UIDs and whatnot could be up to the user (or added later to Allegro).

This PR

OK, so this PR is just a scaffold for al_get_joystick_device_id. In Allegro, there appear to be several backends or "systems", I want to be sure I got them all and the mapping/vtable is correct before continuing with the rest of the functions, and then adding the implementation for MacOS/Windows.

@SiegeLord Is this correct so far?

I'd like to finish and merge this PR with all three functions, and MacOS and Windows support, and a disclaimer that additional platform support could be added later.

@MarkOates MarkOates force-pushed the new-joystick-features branch 3 times, most recently from db1db3f to 4ee77d1 Compare March 23, 2023 16:22
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.

1 participant