POSITION:028,114
COLOUR:STANDARD
TEXT:00,get_key() will also accept keystrokes from special keys like the function
TEXT:16,keys and arrow keys.
TEXT:32,A demo is ready to show how get_key() can interrupt a countdown from
TEXT:16,100000 to 1. When you view the demo program's source code, see how
TEXT:16,get_key() is located in a program loop, like the "while" statement.
TEXT:16,This makes sense, as the keyboard buffer should be repeatedly checked
TEXT:16,for any waiting keystrokes.
TEXT:32,The one keystroke that cannot be accepted by a Euphoria program is
TEXT:16,Ctrl-C, generated by either pressing the c or break key while holding
TEXT:16,down the Ctrl key at the same time. If you press these combination of
TEXT:16,keys, the operating system will abruptly stop the program. In the case of
TEXT:16,larger, more complex programs, this can result in an unexpected loss of
TEXT:16,data. It would be preferable for the program to know that Ctrl-C has
TEXT:16,been pressed and perform an orderly shutdown.
