Namespace: Input

Input

The static class that handles input data from the keyboard and gamepads.

Members

Input.date number staticreadonly

The time of the last input in milliseconds.

Input.dir4 number staticreadonly

The four direction value as a number of the numpad, or 0 for neutral.

Input.dir8 number staticreadonly

The eight direction value as a number of the numpad, or 0 for neutral.

Input.gamepadMapper Object static

A hash table to convert from a gamepad button to a mapped key name.

Input.keyMapper Object static

A hash table to convert from a virtual key code to a mapped key name.

Input.keyRepeatInterval number static

The interval of the key repeat in frames.

Input.keyRepeatWait number static

The wait time of the key repeat in frames.

Methods

Input.clear () static

Clears all the input data.

Input.initialize () static

Initializes the input system.

Input.isLongPressed (keyName)boolean static

Checks whether a key is kept depressed.

Name Type Description
keyName string

The mapped name of the key.

Returns:
Type Description
boolean True if the key is long-pressed.

Input.isPressed (keyName)boolean static

Checks whether a key is currently pressed down.

Name Type Description
keyName string

The mapped name of the key.

Returns:
Type Description
boolean True if the key is pressed.

Input.isRepeated (keyName)boolean static

Checks whether a key is just pressed or a key repeat occurred.

Name Type Description
keyName string

The mapped name of the key.

Returns:
Type Description
boolean True if the key is repeated.

Input.isTriggered (keyName)boolean static

Checks whether a key is just pressed.

Name Type Description
keyName string

The mapped name of the key.

Returns:
Type Description
boolean True if the key is triggered.

Input.update () static

Updates the input data.