QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: Jaze on May 19, 2021, 12:54:45 am
-
I'm using INKEY$ to read the left and right arrow keys. The trouble I'm having is when the arrow key is held down. When the arrow key is pressed, the paddle on the screen moves in the corresponding direction. When the arrow key is held down the paddle moves once, pauses for a moment and then moves continuously. Is there any way to get rid of that pause?
-
I think the delay is controlled by the OS.
-
Hi the delay is the Os wait time before auto repeat starts best way to avoid it is to use _keydown instead.
-
In the old QBasic days, we used INP for that, which is still available in QB64. INP has some baggage of its own, as to how to implement it properly. The new key functions, like the example given in a previous text, would probably be your best bet. QB64 aslso offers _KEYCLEAR, if you need to clear the keyboard buffer.
INKEY$ is great for text programs, but was not made gaming.
Pete