QB64.org Forum

Active Forums => QB64 Discussion => Topic started by: MrFreyer on August 12, 2020, 04:55:00 pm

Title: Buffer for _AXIS and _BUTTON command?
Post by: MrFreyer on August 12, 2020, 04:55:00 pm
Hi all,
is there an internal buffer for the _AXIS and the _BUTTON command?

If my game has a really low framerate and I mash a button, on the controller, repeatedly, the game runs the specific action for a few seconds, even if no further buttoninput is done... Same with the analog stick (_AXIS). Sadly this is really annoying :D
If I use the keyboard (_KEYDOWN) while the game have a low framerate, I have to press the keys for a few milliseconds, till the game detect the input, but instantly stops an action when the key isn't pressed anymore.
This is much better than the controller-problem.

Thanks for answers and help.
Title: Re: Buffer for _AXIS and _BUTTON command?
Post by: TempodiBasic on August 12, 2020, 06:41:27 pm
maybe is it possible that joystick and pad have the same structure of mouse management...
in that case we need a loop to clean the buffer of input like we do with mouse.

I'll investigate later....
Title: Re: Buffer for _AXIS and _BUTTON command?
Post by: FellippeHeitor on August 12, 2020, 06:52:44 pm
Yes, there is a buffer, just like with the mouse. You want a loop like this:

Code: QB64: [Select]

That's before you read _AXIS and _BUTTON, then they'll behave kind of like _KEYDOWN.