Input Class

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

Item Index

Methods Properties

Methods

clear () [static]

Clears all the input data.

initialize () [static]

Initializes the input system.

isLongPressed  ( keyName ) Boolean [static]

Checks whether a key is kept depressed.

Parameters:

  • keyName String

    The mapped name of the key

Returns:

Boolean:
True if the key is long-pressed

isPressed ( keyName ) Boolean [static]

Checks whether a key is currently pressed down.

Parameters:

  • keyName String

    The mapped name of the key

Returns:

Boolean:
True if the key is pressed

isRepeated ( keyName ) Boolean [static]

Check if a key is just pressed or a key repeat occurred.

Parameters:

  • keyName String

    The mapped name of the key

Returns:

Boolean:
True if the key is repeated

isTriggered ( keyName ) Boolean [static]

Checks whether a key is just pressed.

Parameters:

  • keyName String

    The mapped name of the key

Returns:

Boolean:
True if the key is triggered

update () [static]

Updates the input data.

Properties

date Number [static]

[read-only] The time of the last input in milliseconds.

dir4 Number [static]

[read-only] The four direction value as a number of the numpad, or 0 for neutral.

dir8 Number [static]

[read-only] The eight direction value as a number of the numpad, or 0 for neutral.

gamepadMapper Object [static]

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

keyMapper Object [static]

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

keyRepeatInterval Number [static]

The interval of the key repeat in frames.

keyRepeatWait Number [static]

The wait time of the key repeat in frames.