forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gamepad: Add an Android mapping function for Stadia Controller
The default mapping function maps all buttons and axes correctly except for the Assistant and Capture buttons. This CL adds a new mapping function that maps these buttons correctly. On Linux, HID Button usages are mapped to scancodes in the BTN_GAMEPAD and BTN_TRIGGER_HAPPY ranges. Android translates the BTN_GAMEPAD scancodes into KeyEvent.KEYCODE_BUTTON_* keycodes, but BTN_TRIGGER_HAPPY scancodes do not have equivalent Android keycodes and are translated to KeyEvent.KEYCODE_UNKNOWN. This CL allows KeyEvents with BTN_TRIGGER_HAPPY scancodes to be handled as if they were generic gamepad keys. Bug: 1208042 Change-Id: Ie3b6850206cce43ec0d4dbd25d325673c9a2cf11 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2907058 Commit-Queue: Matt Reynolds <mattreynolds@chromium.org> Reviewed-by: James Hollyer <jameshollyer@chromium.org> Cr-Commit-Position: refs/heads/master@{#885748}
- Loading branch information
Showing
4 changed files
with
108 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters