viewtopic.php?t=13625
<B>Suggested function:</B> KeyboardTest()
<B>Platform:</B> Windows and Linux
<B>Return:</B> True/False
Without experience, it is difficult to know what ExamineKeyboard() is doing. It would appear to flush out the keyboard buffer and then take a snapshot of the current pressed keys (if any). The problem seems to be that a following KeyboardInkey command, if used as a true/false test, does destroy buffer content as one would expect. Thus it does not seem possible to KeyboardInkey again immediately, this time with the intention of grabbing the character. This is indicated in the thread mentioned above.
This proposal then, is for a similar routine to KeyboardInkey that does not destroy the keyboard buffer. It would thus allow:-
Code: Select all
Repeat
achar$=""
If KeyboardTest()
achar$=KeyboardInkey()
Else
Test the timer
If Timeout
achar$="Telltale"
EndIf
EndIf
Until achar$<>""