Skip to content

gf.disconnectGamepad

Disconnects a previously connected gamepad and removes it from the registry.

Internally the method uses gamepad.disconnect. You can either disconnect the gamepad using this method or use gamepad.disconnect directly.

If the gamepad does not exist, an error is thrown.

describe('Gamepad tests', function () {
it('Disconnects an existing gamepad', async () => {
await gf.connectGamepad('my-gamepad');
// ...
await gf.disconnectGamepad('my-gamepad');
});
});