Re: [w3c/gamepad] gamepadconnected/disconnected events & non-"fully active" documents (#149)

Chrome has a test-only interface window.gamepadController with methods connect, dispatchConnected, disconnect, setId, setButtonCount, setButtonData, setAxisCount, setAxisData, and setDualRumbleVibrationActuator. I don't think there's any IDL for the test-only interface but you can see how the methods are called in the tests here:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/gamepad/

**connect(i)** -> Update the gamepad buffer to mark the gamepad at index i connected, but don't fire a gamepadconnected event.
**dispatchConnected(i)** -> If the gamepad at index i is connected, dispatch a connection event.
**disconnect(i)** -> Update the gamepad buffer to mark the gamepad at index i disconnected, and fire a gamepaddisconnected event.
**setId(i, idString)** -> Update the ID string for the gamepad at index i to idString.
**setButtonCount(i, buttonCount)** -> Update the gamepad buffer to set the button count for the gamepad at index i to buttonCount.
**setButtonData(i, buttonIndex, value)** -> Update the gamepad buffer for the gamepad at index i to set the value of the button at index buttonIndex to value. The button's pressed value is also updated.
**setAxisCount(i, axisCount)** -> Update the gamepad buffer to set the axis count for the gamepad at index i to axisCount.
**setAxisData(i, axisIndex, value)** -> Update the gamepad buffer for the gamepad at index i to set the value of the axis at index axisIndex to value.
**setDualRumbleVibrationActuator(i, enabled)** -> If enabled is true, updates the gamepad at index i to add a vibrationActuator with type "dual-rumble". If false, updates the gamepad at index i to set the vibrationActuator to null.

I think the Gecko interface would work fine for our tests.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/issues/149#issuecomment-861127640

Received on Tuesday, 15 June 2021 02:47:00 UTC