Difference between revisions of "Key.get"
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <c>key.get</c> removes and returns the next key in the keyboard input buffer. If the input buffer is currently clear (empty), then this method waits until | + | <c>[[key]].get</c> removes and returns the next key in the keyboard input buffer. If the input buffer is currently clear (empty), then this method waits until |
a key is pressed. Note that modifier keys (shift, alt, etc.) pressed alone do not go into the input buffer. | a key is pressed. Note that modifier keys (shift, alt, etc.) pressed alone do not go into the input buffer. | ||
Line 6: | Line 6: | ||
== Example == | == Example == | ||
− | <ms>print "You pressed: " + | + | <ms>k = key.get |
+ | print "You pressed: " + k + " which is char(" + k.code + ")"</ms> | ||
[[Category:Mini Micro]] | [[Category:Mini Micro]] |
Latest revision as of 13:30, 6 August 2020
key.get
removes and returns the next key in the keyboard input buffer. If the input buffer is currently clear (empty), then this method waits until
a key is pressed. Note that modifier keys (shift, alt, etc.) pressed alone do not go into the input buffer.
See also: key.available
Example
k = key.get
print "You pressed: " + k + " which is char(" + k.code + ")"