User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

el:key [2016/01/01 22:39] (current)
Line 1: Line 1:
 +===== Key =====
 +==== Format ====
 +==== Description ====
 +Immediately returns an integer value corresponding to the currently pressed keyboard key.  If no key has been pressed since the last call to the **key** function then the number zero (0) will be returned. ​ This function returns the code for the key pressed not always the ASCII value of the character.
 +==== Note ====
 +if key = 47 then print key
 +will not display the desired results, because it's calling key twice in succession, and will return different values each time.  This code will do what you want:
 +a = key
 +if a = 47 then print a
 +==== Partial List of Keys ====
 +|Down Arrow=16777237|Up Arrow=16777235|Left Arrow=16777234|Right Arrow=16777236||||
 +[[http://​​doc/​qt-4.8/​qt.html#​Key-enum|Click here for a complete list of key values]]
 +==== Example====
 +#press any keys
 +pause 1
 +a = key
 +print a+" ​ "​+chr(a)
 +goto loop
el/key.txt ยท Last modified: 2016/01/01 22:39 (external edit)