Key

From MiniScript Wiki
Revision as of 19:47, 26 January 2022 by JoeStrout (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.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