Keyboard input/Keypress check: Difference between revisions

m
Use inputReady instead of the deprecated function keypress
(FutureBasic solution added)
m (Use inputReady instead of the deprecated function keypress)
 
(4 intermediate revisions by 2 users not shown)
Line 1,384:
goto "#return"
</syntaxhighlight>
 
=={{header|RPL}}==
≪ '''IF''' KEY '''THEN''' 'Entry' STO '''END''' ≫
If no key is pressed and the <code>Entry</code> variable does not exist yet, it won't be created.
 
=={{header|Ruby}}==
Line 1,440 ⟶ 1,444:
The library [http://seed7.sourceforge.net/libraries/keybd.htm keybd.s7i] defines
the file [http://seed7.sourceforge.net/libraries/keybd.htm#KEYBOARD KEYBOARD] and
the function [http://seed7.sourceforge.net/libraries/keybd.htm#keypressed%28in_keyboard_file%29inputReady(in_console_keybd_file) keypressedinputReady],
which can be used to determine if a key has been pressed.
<syntaxhighlight lang="seed7">if keypressedinputReady(KEYBOARD) then
writeln("A key was pressed");
else
Line 1,490 ⟶ 1,494:
 
=={{header|Wren}}==
<syntaxhighlight lang="ecmascriptwren">import "scheduler" for Scheduler
import "timer" for Timer
import "io" for Stdin, Stdout
28

edits