onGamepadDisconnect(action: (gamepad: KGamepad)=>void): KEventController

Register an event that runs when a gamepad is disconnected.

paramaction- The function that runs when quit() is called.

// watch for a controller disconnecting
onGamepadDisconnect((gp) => {
    debug.log(`ohbye player ${gp.index + 1}`);
});

returnsThe event controller.

sincev3000.0

kaplay logo

Misc

Layer