简体   繁体   中英

Gamepad API not detecting Xbox controller in Chrome on Windows server 2012

I'm trying to use the gamepad API to connect to an Xbox controller in google chrome. I'm running into an issue where after plugging the controller in and pressing some buttons on the controller, navigator.GetGamepads() is not returning any gamepad objects in its array, all values are null.

This is only happening with Chrome on Windows Server 2012. I've tried Firefox and the gamepad is detected normally. Running on Windows 8.1, Server 2016, and Windows 10 chrome detects the gamepad normally.

I've tried copying the Xbox drivers from my windows 8.1 computer to the server 2012 yet navigator.GetGamepads() still does not return anything. I downgraded my windows 8.1 Xbox drivers to the same driver version running on Server 2012 and everything worked fine on Windows 8.1 still.

When looking at chrome://device-log/ I can see the 360 controller show up as a device when it is plugged and unplugged so chrome can see it but for some reason doesn't seem to be parsing it as a gamepad.

Any thoughts on what could be causing navigator.GetGamepads() to fail only on chrome running on Windows Server 2012? I've been using Chrome 76.

On Windows Server 2012, Windows 8, and later Chrome looks for xinput1_4.dll. On earlier versions, it looks for xinput9_1_0.dll.

See XInputDllFileName here:

https://cs.chromium.org/chromium/src/device/gamepad/gamepad_platform_data_fetcher_win.cc?l=74

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM