-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[rcore] Inconsistency in the API between GetGamepadButtonPressed()
and GetKeyPressed()
#4007
Comments
@bohonghuang Actually that's the original implementation for Gamepad and it also was for Keys, some years after that the keys queue was added for convenience. Simply, noone had that requirement before for gamepad. Do you need it for some specific use-case or is it only for library consistency reasons? |
Sure, I want my game to support both gamepad and keyboard controls simultaneously, but I've encountered issues when trying to handle gamepad and keyboard inputs using the same logic. IMO, the current
|
@bohonghuang As per my understanding, supporting gamepad button queue shouldn't break any existing code base, just add some extra internal functionality, feel free to send a PR, but it is a core functional change and it should be tested on all supported platforms |
GetGamepadButtonPressed
and GetKeyPressed
GetGamepadButtonPressed()
and GetKeyPressed()
@bohonghuang Did you review this issue? Are you sending a PR? |
I'm afraid I may not be able to work on this issue right now because I'm on a work trip and lack both a gamepad and multiple platforms for testing. If you find this issue bothersome, feel free to close it. I might submit a PR later. |
Closing the issue because it's more a feature request than a issue. If a PR is send, it will be reviewed. |
Please, before submitting a new issue verify and check:
Issue description
Hello, I have been trying to use the gamepad input support in Raylib and have noticed that
GetGamepadButtonPressed
doesn't seem to work as expected. It always returns the previously pressed button instead of maintaining a key queue likeGetKeyPressed
, where each call retrieves one key from the queue. However, I have found that this behavior is consistent across all backends, not just GLFW. Is this behavior by design? If it is, it might be worth considering the consistency between APIs. For example, making some distinctions in the naming could be beneficial for clarity and consistency.The text was updated successfully, but these errors were encountered: