Currently, text can be accepted from the user during program execution mainly
via 3 primitives: key?, readchar and read.
key?: is read as true or false according to whether a key
has been pressed or not since the start of program execution.
readchar:
If key? is false, the program is paused until the user presses
a key.
If key? is true, it gives the key which was pressed last.
These are the values given for particular keys:
Table:
Values for particular keys
A --> 65
B --> 66
C --> 67
etc ...
Z --> 90
--> -37 or -226 (NumPad)
--> -38 or -224
--> -39 or -227
--> -40 or -225
Echap --> 27
F1 --> -112
F2 --> -113
....
F12 --> -123
Shift --> -16
Espace --> 32
Ctrl --> -17
Enter --> 10
If you are uncertain about the value returned by a key, you can type:
pr readchar. The interpreter will then wait for you to type
on a key before giving you the corresponding value.
read list_title word: Presents a dialogue box whose title
is list_title. The user can then input a response in a text
field, and the response will be stored in the form of a word or a list (if the user wrote several words) in the variable :word, and will be evaluated when the OK button is pressed.