[back to index]

Library Reference (v 0.9.0)

Input

Responding to key presses!
Input.justpressed(Key.ENTER):Bool
True if the key has been pressed this frame.
Input.pressed(Key.LEFT):Bool
True if this key is currently held down.
Input.justreleased(Key.SPACE):Bool
True if the key has been released this frame
Input.forcerelease(Key.SPACE)
If the player is holding down this key, 'force' release it. Future calls to Input.pressed() will return false until the player lifts their finger and presses it again. If you call Input.forcerelease() without any parameters, it releases all keypresses.
Input.delaypressed(Key.Z, 5):Bool
True once every N frames, if the key is pressed.
Input.pressheldtime(Key.Z):Int
Tells you how many frames a key has been pressed down for.
Input.getchar():String
Returns the last letter pressed.
Input.keyname(Key.SEMICOLON):String
Returns a string with the name of the given key. For example, Key.SEMICOLON returns ;, Key.SPACE returns Space, Key.PAGEDOWN returns Page Down.