Expose Additional Joystick Information #1426
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andvendor_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.