DAY 006: _KEYCLEAR
#2
I love _KEYCLEAR. Anyone who doesn't needs to be put in a paper bag... Well, you all know the drill!

In the QJurASCIIc Period, we had to code ways to clear the key buffer like: WHILE LEN(INKEY$): WEND

So many uses...

SLEEP will store a keystroke. Using _KEYCLEAR after it will get rid of it.

If a user holds down keys, but only one unique response needs to be registered, using _KEYCLEAR clears the rest of the duplicate entries out of the buffer.

Can be used to control the repeat rate as follows:

Code: (Select All)
DO
    _LIMIT 120
    b$ = INKEY$
    IF LEN(b$) THEN
        PRINT b$;
        _DELAY .1
        _KEYCLEAR ' Alternative 'WHILE LEN(INKEY$): WEND
    END IF
LOOP

Anyway, very neat and handy tool for us SCREEN ZERO Heroes. No "Fire up the bag!" rating, here.

Thanks Magic 8-Ball,

Pete
Reply


Messages In This Thread
DAY 006: _KEYCLEAR - by SMcNeill - 11-11-2022, 04:33 PM
RE: DAY 006: _KEYCLEAR - by Pete - 11-11-2022, 06:55 PM
RE: DAY 006: _KEYCLEAR - by PhilOfPerth - 11-11-2022, 11:49 PM



Users browsing this thread: 1 Guest(s)