Referencing the Keyboard Keys


The keys on the keyboard are specified by using their corresponding ASCII values. For example, suppose that you wanted your program to wait until the "A" key is pressed. Since the ASCII value for the letter "A" is 65, you could use:

Call wait key (65)

Or, if you didn't know the ASCII value for the letter "A", you could use:

Call wait key (ascii("A"))

Or, you could simply use:

Call wait key ("A")

(When referencing uppercase letters, don't forget to hold the shift key down. )

Special Keys

In addition to the standard ASCII characters, the keyboard also contains some "special" keys (labelled "Esc", "Tab", etc.) As of Version 10.9.08 and later, each of the "special" keys can be referenced either by its ASCII value (if you know it), or by the key's name:

ASCII ValueName
8Backspace
9Tab
13Enter
27Esc
32Space
274Alt
315-324F1-F10
327Home
328Up Arrow (or Uparrow)
329Page Up (or Pageup)
331Left Arrow (or Leftarrow)
333Right Arrow (or Rightarrow)
335End
336Down Arrow (or Downarrow)
337Page Down (or Pagedown)
338Insert
339Delete
389-390F11-F12

(Notice that the first letter of a key's name should be upper case.)

For example, to wait for the "Page Down" key to be pressed, you could use any of the following statements:

Call wait key (337)

Call wait key (Page Down)

Call wait key ("Page Down")



  [ Webmaster | FAQ's | Home Page | Contact Us ]