Open bohonghuang opened 3 months ago
@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?
@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 GetGamepadButtonPressed
has limited applications because it always returns the last pressed button, so that I can hardly find its use case:
GetKeyPressed
and occasionally use IsKeyPressed
.IsKeyDown
for keyboard inputs.@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
@bohonghuang Did you review this issue? Are you sending a PR?
@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.
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.