QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The _CONSOLEINPUT function is used to monitor any new mouse or keyboard input coming from a $CONSOLE window. It must be called in order for _CINP to return valid values. Windows-only.

Syntax

infoExists%% = _CONSOLEINPUT

Description

Example(s)

Reading individual key strokes from a console window (Windows).


$CONSOLE:ONLY
_DEST _CONSOLE: _SOURCE _CONSOLE

PRINT "Press any key, and I'll give you the scan code for it.  <ESC> quits the demo."
PRINT
PRINT
DO
    x = _CONSOLEINPUT
    IF x = 1 THEN 'read only keyboard input ( = 1)
        c = _CINP
        PRINT c;
    END IF
LOOP UNTIL c = 1
END

See Also