Function

onGamepadDisconnect

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

Register an event that runs when a gamepad is disconnected.

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

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

returns The event controller.

since v3000.0

group Input

subgroup Gamepad

kaplay logo

Components