Difference between revisions of "Key"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "In Mini Micro, the <msinline>key</msinline> module is a small collection of functions related to detecting the keyboard state and handling the keyboard input buffer, as we...")
 
m
 
(3 intermediate revisions by 2 users not shown)
Line 8: Line 8:
 
|-
 
|-
 
| [[key.get]] || pull the next key out of the input buffer (waiting if necessary)
 
| [[key.get]] || pull the next key out of the input buffer (waiting if necessary)
 +
|-
 +
| [[key.put]](keyChar) || allows you to enqueue a string, or single character by code point, into the keyboard buffer
 
|-
 
|-
 
| [[key.clear]] || clear the input buffer
 
| [[key.clear]] || clear the input buffer
Line 21: Line 23:
  
 
[[Category:Mini Micro]]
 
[[Category:Mini Micro]]
 +
[[Category:Soda]]
 +
[[Category:Farmtronics]]

Latest revision as of 09:38, 17 July 2024

In Mini Micro, the key module is a small collection of functions related to detecting the keyboard state and handling the keyboard input buffer, as well as interfacing with button inputs on joystick/gamepad devices.

Method Purpose
key.available check whether there is a keypress in the input buffer
key.get pull the next key out of the input buffer (waiting if necessary)
key.put(keyChar) allows you to enqueue a string, or single character by code point, into the keyboard buffer
key.clear clear the input buffer
key.pressed(keyName="space") check whether a specific key is currently down
key.keyNames get list of all possible names for key.pressed
key.axis(axis="Horizontal") get value (-1 to 1) of an analog input axis

See also: input; mouse