Skip to content

gf.getGamepad

Retrieves a connected gamepad instance by its identifier.

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

describe('Gamepad tests', function () {
it('Retrieves a connected gamepad by id', async () => {
await gf.connectGamepad('pad-1');
const gamepad = gf.getGamepad('pad-1');
expect(gamepad.id).toBe('pad-1');
});
});