A gamepad object
Configuration of which buttons / analogs map to which indexes
Whether the left analog is currently being held
Whether the right analog is currently being held
Static
baseThe base analogs position when it is not in use
Static
AXESAnalog thumb sticks
Static
AXES_Static
AXIS_The range at which axis changes are detected
Static
ANALOG_The range at which the analog is considered to be dropped -0.09 - 0.09
Static
TRIGGER_The value at which holding a trigger (LT OR RT) will consider it being pressed
Static
PRESSEDValue to indicate a pressed button
Static
UNPRESSEDValue to indicate a button is not pressed
Static
BUTTONS_A button map that maps common button names to the indexes the computer knows them as
Static
BUTTONS_A reverse map of the button names
Static
PS4_A small remapped version of the controllers button_map with PS4 alternatives
Static
GAMEPAD_PS: Playstation vendor Xbox: XBOX vendor PC: Computer PC vendor Android: Android device vendor
Object full of the currently held down buttons
Info about the controller
The left analogs position
The right analogs position
Object of stored callback that will call when a button is pressed
Object of stored callback that will call when a button is released
Object of stored callbacks that will call when the axis is changed
The timestamp of the gamepad.
The index of the controller.
The gamepad object
The type of controller
Attaches a callback to the specified event.
The event to attach the callback to
The function to be called when the event is triggered
The Controller instance
Removes a callback from the specified event.
The event to remove the callback from
The Controller instance
Handles the input on the buttons.
The button index that was pressed
The value of the button (0 for unpressed, 1 for pressed) 0-1 for buttons that have a range
Whether this button is still being held from a previous frame
Whether this button is being pressed in this current frame.
Vibrate the controller (experimental)
dual-rumble: Dual-rumble describes a haptic configuration with an eccentric rotating mass vibration motor in each handle of a standard gamepad. In this configuration, either motor is capable of vibrating the whole gamepad. The two masses are unequal so that the effects of each can be combined to create more complex haptic effects.
The type of rumble. "dual-rumble", or "vibration"
The start delay before the vibration occurs in ms
The duration of the vibration in ms
The magnitude of the weak actuator (between 0 and 1).
The magnitude of the strong actuator (between 0 and 1).
The pulse() method of the GamepadHapticActuator interface makes the hardware pulse at a certain intensity for a specified duration. (From MDN)
A double representing the intensity of the pulse. This can vary depending on the hardware type, but generally takes a value between 0.0 (no intensity) and 1.0 (full intensity).
A double representing the duration of the pulse, in milliseconds.
Creates a new controller instance and passes the gamepad it will be created with