- From: Matt Reynolds <notifications@github.com>
- Date: Fri, 13 Nov 2026 11:44:23 -0800
- To: w3c/gamepad <gamepad@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/gamepad/issues/124/6863122348@github.com>
nondebug left a comment (w3c/gamepad#124) Agree that certain gamepad interactions should count as user activation. In applications that are designed to be controlled by a gamepad, it's inconvenient if the user needs to interact with a mouse or keyboard to (for instance) launch into fullscreen mode or start an audio context. Chromium already allows gamepad button presses to be counted as user activation. If the document is focused and visible, and if any `GamepadButton.value` is greater than 0.9, the page registers a user activation. The detection is run whenever `navigator.getGamepads()` is called. To better integrate with input events (https://github.com/w3c/gamepad/pull/234), the user activation check should occur in the steps for [To update gamepad state for `gamepad`](https://pr-preview.s3.amazonaws.com/gabrielsanbrito/gamepad/pull/234.html#dfn-update-gamepad-state) where we are already comparing gamepad state to detect input changes. Only button input changes should be considered for user activation. Axis and touch input changes are too easy to trigger accidentally or through jitter, while button presses (`GamepadButton.pressed` changing from false to true) are usually a reliable signal of user interaction. The spec should prefer to lean on the existing definition of "pressed" instead of using an arbitrary value threshold, and should require focus and visibility. The activation timing should be tied to an event to make it easier for listeners to make use of the activation without polling. There are two possible events that can fire with a button press. If the page has previously seen a [gamepad user gesture](https://w3c.github.io/gamepad/#dfn-gamepad-user-gesture), a button press triggers `gamepadrawinputchanged`. If it hasn't observed the gesture, the first button press triggers `gamepadconnected` instead of `gamepadrawinputchanged`. When firing `gamepadconnected`, only count the event as a user activation if a button was actually pressed; if the event fired because a new gamepad was connected or for some other reason, it's not user activation. Similarly, `gamepadrawinputchanged` should only count as user activation if a button was actually pressed. Button presses that occur while the page was not visible or focused do not count as user activation. For instance: if the page loses visibility, then a button is pressed and held, then the page regains visibility, no user activation is recorded even though a naive comparison of the button state between the previous and current snapshots would detect a button press. The spec must ensure that each button press can only count as user activation for one page. -- Reply to this email directly or view it on GitHub: https://github.com/w3c/gamepad/issues/124#issuecomment-6863122348 You are receiving this because you are subscribed to this thread. Message ID: <w3c/gamepad/issues/124/6863122348@github.com>
Received on Friday, 13 November 2026 19:44:28 UTC