Skip to content

Input & keys

Read keyboard and button input from camera scripts.

Input

Namespace

Functions

Method Description
getKey Returns true if this key is currently held down.
getKeyDown Returns true if this key was pressed this frame.
getKeyUp Returns true if this key was released this frame.
getAnalog Returns the value of the analog input for the given axis.
getMouseDelta Returns the position delta of the mouse since the last frame.

getKey

getKey(key: Key) -> boolean

Returns true if this key is currently held down.

Parameters

Name Type
key Key

Returns: boolean


getKeyDown

getKeyDown(key: Key) -> boolean

Returns true if this key was pressed this frame.

Parameters

Name Type
key Key

Returns: boolean


getKeyUp

getKeyUp(key: Key) -> boolean

Returns true if this key was released this frame.

Parameters

Name Type
key Key

Returns: boolean


getAnalog

getAnalog(key: Key) -> number

Returns the value of the analog input for the given axis.

Parameters

Name Type
key Key

Returns: number


getMouseDelta

getMouseDelta() -> Vec2

Returns the position delta of the mouse since the last frame.

Returns: Vec2

Key

Class