Add some joystick functions to input. Enables manipulation of mapping… #3272
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.
…s at runtime
The following functions were added to
Input
:add_joy_mapping(String mapping, bool update_existing)
andremove_joy_mapping(String guid)
for manipulation of gamepad mappings.bool is_joy_known(int device)
defaults to true on all platforms that don't use the remapping code. Otherwise, checks whether the device is mapped.get_joy_guid(int device)
returns the sdl2 device guid if using remapping, defaults to "Default Gamepad"I also documented these and the other joystick related functions. doctool updated quite a bit of things unrelated to this, I hope that's not a problem.
Also I hope the implementation is ok. I added
is_joy_known
andget_joy_guid
toOS
for the default variants. Platforms that use the remapping then override these to call back to InputDefault