Remap PS key to BUTTON_MODE on DS4 joystick
Currently, the PS key on the DS4 joystick maps to HOME, which means that this key will not be delivered to apps. However, such apps as Remote Play require access to this key for proper operation. Map it to BUTTON_MODE here to allow the apps to handle it. Also, map the touchpad click to BUTTON_1, which is a generic gamepad button. The mapping to HOME is not specified in Android. By the Linux spec, it is more correct to generate BUTTON_MODE for this button (even though it is drawn slighly above the two sticks in the spec, and it is physically located more in-line or slightly below these). The historical reason for this mapping was the fact that the touchpad generated a click, which meant that touchpad click was more aligned with the Linux spec. In addition, on some other controllers, this button actually has a "house" drawn on it, which would make it consistent with "HOME", and it is currently mapped to HOME. On this (and several others) joystick, however, there is no such drawing, and BUTTON_MODE is appropriate. In Q, this will be addressed by changing the branded buttons on other controllers to also generate "BUTTON_MODE", and then changing the Generic fallback mapping for BUTTON_MODE to HOME. Bug: 79881694 Test: connected DS4 joystick. Made a test app that overrides dispatchKeyEvent and dumps out every event to the logcat. Then pressed every button to ensure that the keys are generated as expected. In the long run, this will be tested in the CTS test input.cts.tests.AsusGamepadTestCase. Change-Id: I33e922a2c52582f44d65f20024d7dca1f9d05a5e
Loading
Please register or sign in to comment