New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 615656 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
inactive
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Game pad buttons partially working

Reported by vbgu...@gmail.com, May 28 2016

Issue description

Steps to reproduce the problem:
1. From Android device running Chrome go to the website http://tutsplus.github.io/Using-the-HTML5-Gamepad-API/test3.html
2. Connect Gamepad via Bluetooth (I am using http://www.amazon.com/True-Depth-3D-Bluetooth-Smartphones/dp/B012OZ8G22/ref=sr_1_1?s=videogames&ie=UTF8&qid=1464473082&sr=1-1&keywords=true+depth+3d+bt+motion+wireless+bluetooth+gamepad)
3. Start pressing the buttons on the game pad.

What is the expected behavior?
All of the buttons on the game pad should register on the webpage.  

What went wrong?
The D-pad, the right analog stick, and the L2 & R2 buttons do not register.  The other buttons do.

Did this work before? N/A 

Chrome version: 50.0.2661.89  Channel: n/a
OS Version: 6.0.1
Flash Version: 

The game pad works 100% in the current version of Firefox for Android for the same game pad and web page.
 
Owner: changwan@chromium.org
Status: Assigned (was: Unconfirmed)
changwan@ Could you please help us triaging?
Cc: changwan@chromium.org
Components: IO>Gamepad
Owner: aelias@chromium.org
I'm not familiar with gamepad. Alex, could you help triage this?
I have posted a potential fix for this issue: https://codereview.chromium.org/2065383004/

Comment 4 by vbgu...@gmail.com, Jul 17 2016

Any idea which version of Chrome will have this update and ETA? Thanks again!
I am from Construct 2 community. We also export HTML5 games to Android using Cordova and Crosswalk. Understandably, the exported Android HTML5 game in the apk also has this gamepad issue. Please fix this issue as the Construct 2 community will benefit from this too.

Comment 6 by aelias@chromium.org, Sep 14 2016

Cc: bajones@chromium.org
Unfortunately, I don't think Chromium can reasonably commit to maintaining PC gamepad mappings.  There's an infinite variety of them and we can't land a fix for each 0.05% prevalence gamepad that might be out there.  The mapping database would just gradually get bloated with random mappings for whatever gamepad someone happened to test, without ever addressing the problem 100%.  The only practical approach is for Chromium to just provide button/axis information at all, making it the responsibility of JS to provide remapping of arbitrary gamepads.

In other words, I'm willing to treat actually dropped/totally unavailable gamepad inputs as a Chromium bug deserving of a patch to fix, but not "mis-mapped" inputs.
I believe it is never Chrome's responsibility to take care of all button mapping for all gamepads out there. This is also the case for all Windows games, and what each game could do is to have the player set the gamepad configuration mapping themselves. 

In fact, Azure Striker Gunvolt has dealt with this issue quite well. The game shows the gamepad on screen and asks the player to press each highlighted button one by one (this is from D-Pad, X-Axis Analog Stick, Y-Axis Analog stick to the Trigger buttons, covering pretty much all the possible inputs) to store information of "physical" mapping accordingly. 

Actually, the main concern now is that not all keys are being detected. It doesn't matter if the mapping is wrong, the game can provide configuration (like above) to fix that part. But if not all inputs can be detected when Firefox and Android native apps could receive all the inputs just fine, then that's an issue that must be fixed. 

Thank you.

Comment 8 by aelias@chromium.org, Sep 15 2016

Cc: 999ionos...@gmail.com
> Actually, the main concern now is that not all keys are being detected.

Agreed, I do consider that a bug.  Can you provide a specific gamepad and Android version exhibiting this problem?

Comment 9 by aelias@chromium.org, Sep 15 2016

OK, I see there is one mentioned in #0 in http://www.amazon.com/True-Depth-3D-Bluetooth-Smartphones/dp/B012OZ8G22/.
I have tested with the following gamepads and they all yield identical result of this issue:

- MOGA Pro Power
- IPEGA PG-9021
- Razer Serval

I have tried with other Android gamepads from my local hardware vendor too, and they also have this issue.

My Android version is 5.0.
Software info: WW_2.20.40.149_20160504
Just tested on Gamesir G3S on my Android. Also, the same issue.
Project Member

Comment 12 by bugdroid1@chromium.org, Sep 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2ec0b0c09fc2cfd30d2ef3b1a7e292c00d0369a8

commit 2ec0b0c09fc2cfd30d2ef3b1a7e292c00d0369a8
Author: aicommander <aicommander@gmail.com>
Date: Sat Sep 17 19:36:07 2016

Gamepad: Improve gamepad mapping code and unknown gamepad heuristics

This CL modifies the GamepadMappings class to use subclasses
for mappings rather than static methods. The advantage is that
the unknown gamepad mapping can keep state around that allows
it to create heuristic mappings at GamepadDevice constrution
time. This allows stable mappings that don't depend on input
to decide correctly. This also means we aren't doing string
parsing on each gamepad event anymore.

With this change, Moga Pro, Nexus Player (ASUS) Gamepad, and Razer
Serval controllers are working correctly without explict mappings.

Before the change, the D-Pad on Moga, Serval, and ASUS Gamepad were
non-functional. The triggers on the Moga didn't work at all, and the
Serval and ASUS Gamepad's triggers were swapped with the shoulder
buttons.

TEST=http://html5gamepad.com/
BUG= 615656 

Review-Url: https://codereview.chromium.org/2071223002
Cr-Commit-Position: refs/heads/master@{#419372}

[modify] https://crrev.com/2ec0b0c09fc2cfd30d2ef3b1a7e292c00d0369a8/device/gamepad/android/java/src/org/chromium/device/gamepad/GamepadDevice.java
[modify] https://crrev.com/2ec0b0c09fc2cfd30d2ef3b1a7e292c00d0369a8/device/gamepad/android/java/src/org/chromium/device/gamepad/GamepadMappings.java
[modify] https://crrev.com/2ec0b0c09fc2cfd30d2ef3b1a7e292c00d0369a8/device/gamepad/android/junit/src/org/chromium/device/gamepad/GamepadMappingsTest.java

Status: Fixed (was: Assigned)
Should be fixed in the next Chrome 55 Dev sometime next week (not the current 55.0.2860.0, but the next revision).

Comment 14 by vbgu...@gmail.com, Sep 17 2016

Awesome! Thanks everyone!!
Components: -IO>Gamepad Blink>GamepadAPI

Sign in to add a comment