[ Home ]

Library Documentation (v 0.12.1)

Input

Responding to key presses!
Input.justpressed(Key.ENTER):Bool
True if the key has been pressed this frame. (Use Key.ANY to check if any key is pressed this frame.)
Input.pressed(Key.LEFT):Bool
True if this key is currently held down. (Use Key.ANY to check if any key is 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 or with Key.ANY, 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.getkeyfromcharacter(c:String):Key
Returns a key matching the given character. Doesn't work for every character. For example, "a" returns Key.A.
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.