Bug 235052 - Gamepad joystick axis not being recognized as a gesture
Summary: Gamepad joystick axis not being recognized as a gesture
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Safari 15
Hardware: All Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-10 16:39 PST by Shawn O'Connor
Modified: 2022-11-29 05:59 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn O'Connor 2022-01-10 16:39:49 PST
Chromium browsers fire a gamepadconnected event when a button is pressed or an axis is used, Safari seems to only do so when a button is pressed.
See: https://developer.mozilla.org/en-US/docs/Web/API/Window/gamepadconnected_event

Repro steps:
1) Connect a supported game controller
2) Force kill the Xbox Cloud Gaming PWA and launch it to simulate a fresh start.
3) Move the left joystick. Nothing will happen in the UI. This is what users are attempting to do in the Xbox Cloud Gaming home screen, and this leads them to believe that the service isn't working with their controller since the UI isn't being perturbed.
4) Move the d-pad or perform any digital input (LB/RB, ABXY, etc.). You should now see the UI respond. There seems to be a bug where the Xbox Cloud Gaming home screen doesn't pick up joystick inputs on a fresh start. To users, this feels like the UI isn't responding to controller input.

The important thing is having the game controller connected when starting the PWA. In this case, there is no connect event that occurs as part of the plug-in and instead the connection is based on the user input.
Comment 1 Radar WebKit Bug Importer 2022-01-12 09:33:21 PST
<rdar://problem/87464091>
Comment 2 Calogero Mauceri 2022-11-29 05:59:22 PST
I am experiencing the same issue. The gamepadconnected event is not emitted when a gamepad is already connected to the machine and the stick/axis is moved, but only when a button is pressed.
This is different than what stated in the documentation, i.e. "The gamepadconnected event is fired when the browser detects that a gamepad has been connected or the first time a button/axis of the gamepad is used."

It properly works on Firefox and Chromium browsers.