onGamepadButtonDown(btn: KGamepadButton | KGamepadButton[], action: (btn: KGamepadButton, gamepad: KGamepad)=>void): KEventController
Register an event that runs every frame when certain gamepad buttons are held down.
param
btn- The button(s) to listen for. See
param
action- The function that is run while certain gamepad buttons are held down.
// when button is being held down onGamepadButtonDown("rtrigger", (gp) => { car.addForce(Vec2.fromAngle(car.angle).scale(10)); });
returns
The event controller.
since
v3001.0