InputDevice

InputDevice

new InputDevice()

Look at the Input reference pages before reading these docs. Root class for storing the state of inputs (mouse, keyboard, gamepads). -3 means input was released after being held, pressed for 12 frames -2 means input was pressed and released on the same frame -1 means input was released 0 means input is not pressed 1 means input was pressed >1 means input is still being pressed 12 means input was held >12 means input is being held
Source:

Methods

held(inp) → {boolean}

Source:
Parameters:
Name Type Description
inp string
Returns:
Type:
boolean
true on the first frame that the user released a held input

holding(inp) → {number}

Source:
Parameters:
Name Type Description
inp string
Returns:
Type:
number
the amount of frames the user has been holding the input

holds(inp) → {boolean}

Source:
Parameters:
Name Type Description
inp string
Returns:
Type:
boolean
true on the first frame that the user holds the input

pressed(inp) → {boolean}

Source:
Parameters:
Name Type Description
inp string
Returns:
Type:
boolean
true on the first frame that the user released the input

presses(inp) → {boolean}

Source:
Parameters:
Name Type Description
inp string
Returns:
Type:
boolean
true on the first frame that the user presses the input

pressing(inp) → {number}

Source:
Parameters:
Name Type Description
inp string
Returns:
Type:
number
the amount of frames the user has been pressing the input

released(inp) → {boolean}

Source:
Parameters:
Name Type Description
inp string
Returns:
Type:
boolean
true on the first frame that the user released the input