Project

General

Profile

Actions

Emulator Issues #11662

closed

Gamepad doesn't work on ChromeOS [includes fix]

Added by ExceptionStock about 5 years ago. Updated about 4 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
Android
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:
5.0-11617

Description

Game Name?

Game-independent but I tried with Super Mario Sunshine

What's the problem? Describe what went wrong.

When using Android version on ChromeOS GamePad can be configured but in the game no reaction to button presses

What steps will reproduce the problem?

  1. Get a Chromebook with Android apps support and a bluetooth gamepad
  2. Install Dolphin from Play Store
  3. Add any game
  4. Go to config and bind the buttons to a bluetooth gamepad
  5. Start a game
  6. Press any buttons on gamepad

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

yes

Is the issue present in the latest stable version?

yes

What are your PC specifications? (CPU, GPU, Operating System, more)

Pixelbook.

Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)

The issue comes from the fact that getDescriptor on ChromeOS returns "" for gamepad which is actually within the specs as the speconly guarantees the stability of ID, and "" is a valid ID. Then in Source/Android/jni/ButtonManager.cpp we have lines like:
sscanf(value.c_str(), "Device '%127[^\']'-Axis %d%c", dev, &bindnum, &modifier);
Unfortunately %127[^\'] doesn't accept empty string, so you need something like:
if (value.find(""Device ''") == 0) {
dev[0] = '\0';
sscanf(value.c_str(), "Device ''-Axis %d%c", &bindnum, &modifier);
} else {
sscanf(value.c_str(), "Device '%127[^\']'-Axis %d%c", dev, &bindnum, &modifier);
}
This needs to be modified in 4 places in Source/Android/jni/ButtonManager.cpp: 2 time with -Button and 2 times wit -Axis.
With this changes gamepad and Dolphin work perfectly on ChromeOS.

Actions

Also available in: Atom PDF