QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: Pete on March 16, 2020, 07:38:20 pm
-
I know SLEEP holds key presses in the buffer, but this one surprised me in that it preserved CHR$(13), even though an arrow down key was the last key pressed before the INKEY$ loop.
PRINT "Inkey$ test. Press Enter" PRINT "Now press arrow down"
blocksize = 4
PRINT:
PRINT "[1] Delete database entry, [0] Delete established listing, [Enter] Allow both."
PRINT "The value of inkey$ is: ";
ASC(b$
)
Of course you can remove the REM statement, so the b$ = INKEY$ can clear the buffer before the INKEY$ loop. I only posted this because I thought the SLEEP statement would return the down arrow character, the last key pressed, instead of the first key pressed, the Enter key CHR$(13). It is probably the same in QBasic or is it not behaving correctly?
Thoughts?
Pete
-
There is no clear of key buffer of keypress from SLEEP so you can create a chain of keypresses from a chain of SLEEP's.
checkout _KEYCLEAR