KEY() doesn't work under console mode

Previous topic - Next topic

FutureCow

I can't find it documented anywhere that it shouldn't work, nor can I find any posts about it.
Trying the following code (compiling it as a console program) you'll see that the key() commands aren't working

Console version

Code (glbasic) Select
STDOUT "Press 1 to be server\n"
STDOUT "Press 2 to be client\n"

WHILE Done=0
IF KEY(02) = 1 // pressed 1
STDOUT "Server\n"
DEBUG "Server-debug\n"
ELSEIF KEY(03) = 1 // pressed 2
STDOUT "Client\n"
DEBUG "Client-debug\n"
ENDIF
WEND


Non console version to compare it to
Code (glbasic) Select

WHILE Done=0
PRINT "Press 1 to be server\n",0,0
PRINT "Press 2 to be client\n",0,20

IF KEY(02) = 1 // pressed 1
PRINT "Server\n",0,30
DEBUG "Server-debug\n"
ELSEIF KEY(03) = 1 // pressed 2
PRINT "Client\n",0,40
DEBUG "Client-debug\n"
ENDIF
SHOWSCREEN
WEND

Kitty Hello

No. Use INKEY, KEYWAIT or INPUT, please.

FutureCow

No problem. Can you please update the documentation accordingly?