justPressed(buttonCode, duration) → {boolean}
Returns the "just pressed" state of a button from this gamepad. Just pressed is considered true if the button was pressed down within the duration given (default 250ms).
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
buttonCode | number | The buttonCode of the button to check for. | ||
duration | number | <optional> | 250 | The duration below which the button is considered as being just pressed. |
Returns
boolean -
True if the button is just pressed otherwise false.
- Source code: input/SinglePad.js (Line 503)
Please login to continue.