Namespace: Input

Input

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

Members

Input.datenumberstaticreadonly

The time of the last input in milliseconds

Input.dir4numberstaticreadonly

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

Input.dir8numberstaticreadonly

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

Input.gamepadMapperObjectstatic

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

Input.keyMapperObjectstatic

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

Input.keyRepeatIntervalnumberstatic

The interval of the key repeat in frames

Input.keyRepeatWaitnumberstatic

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)booleanstatic

Checks whether a key is kept pressed for a long time
NameTypeDescription
keyNamestringThe mapped name of the key
Returns:
TypeDescription
booleanTrue if the key is long-pressed

Input.isPressed(keyName)booleanstatic

Checks whether a key is currently pressed down
NameTypeDescription
keyNamestringThe mapped name of the key
Returns:
TypeDescription
booleanTrue if the key is pressed

Input.isRepeated(keyName)booleanstatic

Checks whether a key is triggered or a key repeat occurred
NameTypeDescription
keyNamestringThe mapped name of the key
Returns:
TypeDescription
booleanTrue if the key is repeated

Input.isTriggered(keyName)booleanstatic

Checks whether a key is triggered (just pressed)
NameTypeDescription
keyNamestringThe mapped name of the key
Returns:
TypeDescription
booleanTrue if the key is triggered

Input.update()static

Updates the input data

Input.virtualClick(buttonName)static

Sets up a virtual click from a button sprite
NameTypeDescription
buttonNamestringThe name of the button