Linux: Firefox exposes reserved Xbox Series buttons and swaps X/Y
@LizardByte-bot is already working on this.
Since Aug 15, 2026.
Assessment
This issue has not been assessed yet.
Description
Environment
- Host OS: Linux
- Virtual controller provider: libvirtualhid through Sunshine
- Profile: Xbox Series
- Browser: Firefox
- Reported identity:
045e-0b13-Sunshine (libvirtualhid) X-Box Series Controller - Tester: https://app.lizardbyte.dev/gamepad-tester/
Observed behavior
- Firefox exposes 20 buttons.
- B17 is the Share button and is now labeled correctly by gamepad-helper.
- B18 and B19 remain visible but do not represent real Xbox Series controls.
- The physical X and Y buttons are swapped.
- Chromium exposes only B17 beyond the standard buttons and reports X/Y correctly.
Source-level explanation
The Linux uinput backend advertises KEY_RECORD for Share and also advertises reserved BTN_C and BTN_Z capabilities to preserve sparse Xbox button slots. Firefox starts with 17 canonical buttons and then appends every advertised nonstandard key capability, producing:
- B17:
KEY_RECORD - B18: reserved
BTN_C - B19: reserved
BTN_Z
Firefox only applies its Xbox-specific BTN_NORTH/BTN_WEST correction when an ancestor driver is named xpad or microsoft. A uinput-created virtual controller does not have either driver ancestry despite using Microsoft VID/PID.
Firefox source:
https://searchfox.org/firefox-main/source/dom/gamepad/linux/LinuxGamepad.cpp
Expected behavior
- Firefox exposes the standard 17 buttons plus Share at B17.
- No phantom B18/B19 controls are presented.
- X and Y match the physical Xbox layout.
Constraints
Steam currently handles this virtual Xbox Series controller correctly and is the priority consumer. Do not remove reserved capabilities or swap emitted X/Y without validating Steam and Chromium. Keep any compatibility change Linux-specific and avoid changing the Windows backend.
- Dominant language
- C++
- Stars
- 57
- Forks
- 15
- Avg merge
- 10h 54m
- Merged PRs (30d)
- 32
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LizardByte/libvirtualhid
-
Difficulty 4/5 3-5 days Newbie friendliness 40/100
LizardByte/libvirtualhid#155 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
LizardByte/libvirtualhid#150 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
LizardByte/libvirtualhid#134 · 1 comment ·
-
LizardByte/libvirtualhid#106 · 1 assignee ·
-
LizardByte/libvirtualhid#84 · 1 assignee ·
All issues in LizardByte/libvirtualhid
Similar issues
-
ai_reviewed
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ydb-platform/ydb#53869 · 3 comments ·
-
bug cert blocker needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
project-chip/connectedhomeip#74373 ·
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conan-io/conan-center-index#31035 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
vllm-project/vllm-ascend#17329 ·