diff options
author | Jared Henderson <jaredh.microsoft@gmail.com> | 2019-08-21 15:37:59 -0700 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-09-20 04:04:43 +0000 |
commit | 4b47b293593674ca69ff4f984df0f8a6b86c6dd5 (patch) | |
tree | 75350c236fecd28ab68532e5d957a4a640381bfa | |
parent | 74f4c0e6f577692ed75b3c46e5daa259abec0f85 (diff) | |
download | android_frameworks_base-4b47b293593674ca69ff4f984df0f8a6b86c6dd5.tar.gz android_frameworks_base-4b47b293593674ca69ff4f984df0f8a6b86c6dd5.tar.bz2 android_frameworks_base-4b47b293593674ca69ff4f984df0f8a6b86c6dd5.zip |
Update Xbox BT controller mapping for new FW
The Xbox controller (product id 0x02fd) is going to have a new firmware
update this fall that sends a different keycode (316/BUTTON_MODE) for
the Xbox button. The goal is to enable the Xbox button to make it to
apps on all Android versions -- with our without a controller-specific
key mapping file.
Unfortunately, the new Vendor_045e_Product_02fd.kl key mapping file
that was added to Android Q maps the pre-firmware-update
Xbox key code (172) to BUTTON_MODE, yet it makes no mention of key 316.
This results in apps getting a raw 316 scan code instead of
a BUTTON_MODE KeyEvent when using a controller with the latest firmware
on Android Q.
The fix is to add an additional key mapping for 316 that *also* maps to
BUTTON_MODE. With both mappings in place, both pre and post
firmware-updated controllers will get the correct behavior for the
Xbox button on Android Q.
Test: AFAIK, no CTS tests exist for Xbox controller key mappings;
we'll need to add some at a later date. I was unable to test this
change because I'm unable to write to the system directory on any
of my devices, but I know that mapping 316 to BUTTON_MODE will
fix the issue.
Signed-off-by: Jared Henderson <jaredh.microsoft@gmail.com>
Bug: 139512030
Bug: 140808513
Merged-In: I8600ea79a0aa8557267d6ca712e5d56680e7a98b
Change-Id: I8600ea79a0aa8557267d6ca712e5d56680e7a98b
(cherry picked from commit b08c0be8a0e83404faa1a0424afe63ff490ddd37)
-rw-r--r-- | data/keyboards/Vendor_045e_Product_02fd.kl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/data/keyboards/Vendor_045e_Product_02fd.kl b/data/keyboards/Vendor_045e_Product_02fd.kl index 512f7e13497..1b03497ae3d 100644 --- a/data/keyboards/Vendor_045e_Product_02fd.kl +++ b/data/keyboards/Vendor_045e_Product_02fd.kl @@ -53,5 +53,10 @@ key 158 BUTTON_SELECT # Hamburger - 3 parallel lines key 315 BUTTON_START -# Xbox key +# There are at least two versions of firmware out for this controller. +# They send different linux keys for the "Xbox" button. +# Xbox key (original firmware) key 172 BUTTON_MODE + +# Xbox key (newer firmware) +key 316 BUTTON_MODE |