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 pressed and released on the same frame
-2 means input was released after being held
-1 means input was released
0 means input is not pressed
1 means input was pressed
>1 means input is still being pressed
Classes
Methods
held(inp) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
inp |
string
|
Returns:
- Type:
-
boolean
true on the first frame that the user released a held input
holding(inp) → {number}
Parameters:
Name | Type | Description |
---|---|---|
inp |
string
|
Returns:
- Type:
-
number
the amount of frames the user has been holding the input
holds(inp) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
inp |
string
|
Returns:
- Type:
-
boolean
true on the first frame that the user holds the input
pressed(inp) → {boolean}
Same as the `released` function, which is preferred.
Parameters:
Name | Type | Description |
---|---|---|
inp |
string
|
Returns:
- Type:
-
boolean
true on the first frame that the user released the input
presses(inp) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
inp |
string
|
Returns:
- Type:
-
boolean
true on the first frame that the user presses the input
pressing(inp) → {number}
Parameters:
Name | Type | Description |
---|---|---|
inp |
string
|
Returns:
- Type:
-
number
the amount of frames the user has been pressing the input