Keyboard input/Keypress check: Difference between revisions

Content added Content deleted
No edit summary
Line 48: Line 48:
==={{header|Applesoft BASIC}}===
==={{header|Applesoft BASIC}}===
<lang ApplesoftBasic>K = PEEK(-16384) : IF K > 127 THEN POKE -16368,0 : K$ = CHR$(K)</lang>
<lang ApplesoftBasic>K = PEEK(-16384) : IF K > 127 THEN POKE -16368,0 : K$ = CHR$(K)</lang>

==={{header|IS-BASIC}}===
<lang IS-BASIC>100 LET K$=INKEY$</lang>

or

<lang IS-BASIC>100 GET K$</lang>


==={{header|ZX Spectrum Basic}}===
==={{header|ZX Spectrum Basic}}===
Line 55: Line 62:
20 LET k$ = INKEY$</lang>
20 LET k$ = INKEY$</lang>


=={{header|BBC BASIC}}==
==={{header|BBC BASIC}}===
<lang bbcbasic> key$ = INKEY$(0)</lang>
<lang bbcbasic> key$ = INKEY$(0)</lang>
If there was no keypress an empty string is returned. Alternatively a numeric key-code may be obtained; if there was no keypress -1 is returned:
If there was no keypress an empty string is returned. Alternatively a numeric key-code may be obtained; if there was no keypress -1 is returned: