Create a new instance of a Controller.
Helper function to append an action.
The name of the action.
An action object to add.
Optional
button?: numberMouse: e.g. pc.MOUSEBUTTON_LEFT
- Gamepad: e.g. pc.PAD_FACE_1
Optional
keys?: number[]Keyboard: A list of keycodes e.g. [pc.KEY_A, pc.KEY_ENTER]
.
Optional
pad?: numberGamepad: An index of the pad to register (use PAD_1, etc).
The name of the action.
Register an action against a controller axis.
Optional
options: { pad?: number }Optional options object.
Optional
pad?: numberThe index of the game pad to register for (use PAD_1, etc).
Create or update an action which is enabled when the gamepad button is pressed.
The name of the action.
The index of the pad to register (use PAD_1, etc).
The pad button.
A general input handler which handles both mouse and keyboard input assigned to named actions. This allows you to define input handlers separately to defining keyboard/mouse configurations.