Author Topic: Buffer for _AXIS and _BUTTON command?  (Read 3458 times)

0 Members and 1 Guest are viewing this topic.

Offline MrFreyer

  • Newbie
  • Posts: 34
    • View Profile
Buffer for _AXIS and _BUTTON command?
« 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.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Buffer for _AXIS and _BUTTON command?
« Reply #1 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....
Programming isn't difficult, only it's  consuming time and coffee

Marked as best answer by MrFreyer on August 12, 2020, 03:20:50 pm

FellippeHeitor

  • Guest
Re: Buffer for _AXIS and _BUTTON command?
« Reply #2 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.