From 0b607447b61e600a319bd2ae85909380dbd3930a Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Tue, 21 Aug 2018 18:30:16 -0700 Subject: [PATCH] Fallback BUTTON_MODE to HOME Currently, BUTTON_MODE falls back to MENU. It is not clear which functionality relies on that. However, many joysticks currently map their "branded" button, for example, the "XBOX" key on the Xbox joystick, and "PS" key on the playstation joystick, to the BUTTON_MODE. On other joysticks, the same button is mapped to "HOME". So it would make sense to have this button to fall back to HOME in order to make the behaviour consistent. Also, remap the "XBOX" button on the Xbox controller to "BUTTON_MODE". This would give apps the chance to intercept this key and actually use it, instead of limiting it to the system. Bug: 37115804 Bug: 77803694 Test: Made a test app to dump out joystick events in response to dispatchKeyEvent. Then either returned true or false to ensure that the fallback happens. If returning true, the app has handled the event, and HOME is not dispatched. If returning false, the app does not care about the event. Therefore, HOME is generated and the phone goes to home screen (so the app gets closed). Change-Id: I023620551f52d34638303db60f8a4ca37f06d4d8 Merged-In: I023620551f52d34638303db60f8a4ca37f06d4d8 --- data/keyboards/Generic.kcm | 2 +- data/keyboards/Vendor_045e_Product_02e0.kl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/keyboards/Generic.kcm b/data/keyboards/Generic.kcm index d0565ca7e8769..1ab4c6385ac1a 100644 --- a/data/keyboards/Generic.kcm +++ b/data/keyboards/Generic.kcm @@ -540,7 +540,7 @@ key BUTTON_SELECT { } key BUTTON_MODE { - base: fallback MENU + base: fallback HOME } key BUTTON_1 { diff --git a/data/keyboards/Vendor_045e_Product_02e0.kl b/data/keyboards/Vendor_045e_Product_02e0.kl index 1012fb1eb28da..1dd8e157c5a70 100644 --- a/data/keyboards/Vendor_045e_Product_02e0.kl +++ b/data/keyboards/Vendor_045e_Product_02e0.kl @@ -56,4 +56,4 @@ key 0x136 BUTTON_SELECT key 0x137 BUTTON_START # Xbox key -key 0x8b HOME \ No newline at end of file +key 0x8b BUTTON_MODE \ No newline at end of file