immersive-web / webxr-gamepads-module

Repository for the WebXR Gamepads Module
https://immersive-web.github.io/webxr-gamepads-module
Other
30 stars 10 forks source link

XR Gamepad behavior in 2D browser windows #19

Closed NellWaliczek closed 2 years ago

NellWaliczek commented 4 years ago

@kearwood mentioned yesterday that Firefox is wanting to have XR gamepads appear in the array returned by getGamepads() when an immersive XR session is not in progress. The reasoning mentioned was that 2D pages with 3D games in a canvas often use the Gamepad api and that end users would be disappointed that the gamepads they're holding in VR do not work. As far as I understand it, due to the nature of the API structure, no 3D pose data will be exposed. When an immersive session is created, it sounded like the plan was to "disconnect" them from navigator and "connect" them in xrsession and visa versa when the xr session ends.

A few things that immediately pop to mind:

Manishearth commented 2 years ago

https://github.com/immersive-web/webxr-gamepads-module/pull/46 turns this into a purely Gamepads-side decision for implementors, though we should add a note about that.