Getting Raw Keyboard Characters in the Console
Author: Carl Sassenrath
If you write REBOL console scripts that need to respond to single keystrokes without requiring the RETURN key, here is a good trick to know.
To make the console respond to single keys, simply change its port to BINARY mode. Here's how:
Now, each time a key is pressed, it will be returned to your script. This works because the console's input port is already in DIRECT mode and setting it to BINARY removes the check for the NEWLINE (LF) character.
Here is an example script:
If you need to return the console to normal text line mode operation (which you will need to do if you want to return to the REBOL command line prompt), just use this: