Difference between revisions of "Key.keyNames"

From MiniScript Wiki
Jump to navigation Jump to search
m (fixed indentation)
m (Fixed broken link and moved "See also" to bottom of page above category)
Line 1: Line 1:
<c>[[key]].keyNames</c> returns a list of all the key names available for use with [[key.pressed. ]]
+
<c>[[key]].keyNames</c> returns a list of all the key names available for use with [[key.pressed]].
 
 
See also: [[key.pressed]]
 
  
 
=== Usage Notes ===
 
=== Usage Notes ===
Line 14: Line 12:
 
     end for
 
     end for
 
end while</ms>
 
end while</ms>
 +
 +
See also: <c>[[key.pressed]]</c>
  
 
[[Category:Mini Micro]]
 
[[Category:Mini Micro]]

Revision as of 18:09, 2 May 2020

key.keyNames returns a list of all the key names available for use with key.pressed.

Usage Notes

This can be used, for example, to check all possible inputs, if waiting for the user to press anything to continue, or while configuring their input preferences.

Example

while true
    for n in key.keyNames
        if key.pressed(n) then print n
    end for
end while

See also: key.pressed