Open Bug 1434408 Opened 6 years ago Updated 11 months ago

Gamepad API doesn't properly handle analog triggers with xbox one controller.

Categories

(Core :: DOM: Device Interfaces, defect, P3)

58 Branch
defect

Tracking

()

People

(Reporter: evan, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.97 Safari/537.36 Vivaldi/1.94.1008.40

Steps to reproduce:

Go to http://html5gamepad.com with an xbox one controller and pull one of the triggers. These are mapped to buttons 6 and 7. In Chromium based browsers, the value is a scalar which will increase proportionally as you pull the trigger. In Firefox, it just jumps from 0 to 1 instantaneously. 
I know analog trigger buttons aren't necessarily included in the standard html5 gamepad model, but it's a very useful feature to have, and the MDN documentation for the gamepad API specifically states that more advanced gamepads have analog triggers that should map to scalar button values. This may also affect other xinput controllers, as the browser just detects it as "xinput".


Actual results:

Button value for analog triggers on xbox one controller jumps from 0 to 1.


Expected results:

Button value for analog triggers should scale smoothly to a value between 0 and 1 depending on how far you pull the trigger.
Component: Untriaged → DOM
Product: Firefox → Core
Priority: -- → P3
Component: DOM → DOM: Device Interfaces
Firefox 60 and 61 list the Left and Right Triggers as Axes instead than Buttons; their rest position is initially 0, but then becomes -1 as soon as the trigger is touched.

This prevents remapping software to correctly detect the gamepad's rest state.


Actual results:
Analog triggers on xbox one/360 controllers are listed among the axes Array, their value going from -1 to 1, with rest value -1.


Expected results:
Analog triggers on xbox one/360 controllers should be listed among Buttons, their value going from 0 to 1, with rest value 0.

In both Firefox 68 and in Nightly 70.0a1, I see the same problem as Evan, where the trigger value jumps from zero to 1. I'm using a Logitech Gamepad F310.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Can confirm that we are seeing this bug in Firefox 77. I can offer an additional piece of info: the triggers work correctly as analog inputs on Linux (Arch and likely all other distros). It’s on Mac and Windows where they only return values of 0 or 1.

Our project is a remote interface for driving RC cars. We’ve found FF to have superior WebRTC latency compared to other browsers, which would make it an excellent remote gaming client if this bug could be fixed. I am happy to assist with further investigation if that would be helpful.

Blocks: 1643833

(In reply to brett.ernst from comment #3)

Can confirm that we are seeing this bug in Firefox 77. I can offer an additional piece of info: the triggers work correctly as analog inputs on Linux (Arch and likely all other distros). It’s on Mac and Windows where they only return values of 0 or 1.

Our project is a remote interface for driving RC cars. We’ve found FF to have superior WebRTC latency compared to other browsers, which would make it an excellent remote gaming client if this bug could be fixed. I am happy to assist with further investigation if that would be helpful.

It seems like Xbox One controller's trigger in FF 77-79 are treated as analog values after the recent Windows OS update. We are also doing some adjustments on Xbox controllers on Mac OS and Windows recently. Please help keep an eye on it about the recent changes.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.