Skip to content

Conversation

@deniska
Copy link
Contributor

@deniska deniska commented Sep 18, 2022

Currently assumes a single gamepad, has no code specific to gamepad detection (gamepad is "detected" when an event related to gamepad arrives). Also assumes that all gamepads look roughly like an xbox/ps controller. Both assumptions are not strictly true, but an implementation like that probably covers 85% of usecases.

Also it doesn't update previousButtonState so functions IsGamepadButtonPressed() and IsGamepadButtonReleased() don't work, but they didn't work previously on Android anyway, and they are flaky on desktop as they are now, so the mechanism for these two functions probably should be reworked anyway.

It's certainly an improvement compared to the previous android gamepad handling code, which put gamepad events into touch related structs.

Currently assumes a single gamepad, has no code specific to gamepad
detection (gamepad is "detected" when an event related to gamepad
arrives). Also assumes that all gamepads look roughly like an xbox/ps
controller. Both assumptions are not strictly true, but an
implementation like that probably covers 85% of usecases.

Also it doesn't update previousButtonState so functions
IsGamepadButtonPressed() and IsGamepadButtonReleased() don't work, but
they didn't work previously on Android anyway, and they are flaky on
desktop as they are now, so the mechanism for these two functions
probably should be reworked anyway.

It's certainly an improvement compared to the previous android gamepad
handling code, which put gamepad events into touch related structs.
@raysan5 raysan5 merged commit 8f597b3 into raysan5:master Sep 18, 2022
@raysan5
Copy link
Owner

raysan5 commented Sep 18, 2022

@deniska Thanks for the improvement! I'm still trying to remember why touch inputs were checked in gamepad events... I'm sure there was some reason for that but anyway...

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.

2 participants