Hi,
I'm using an imx8mp custom board running Android 11. I need to change the MOUSE_SECONDARY button as BACK. I modified the .kl file to change the action ofMOUSE_SECONDARY, but it's not working, is there any other way to change the MOUSE_SECONDARY action?
Thanks & Regards,
Subash P.
Solved! Go to Solution.
Hi,
This could be done with two different ways: 1. framework layer, 2 kernel event system.
For such remapping on aosp framework, you may need to modify synthesizeButtonKeys function in https://android.googlesource.com/platform/frameworks/base/+/a45746e/services/input/InputReader.cpp, filter the mouse MOUSE_SECONDARY event , mapping it to KEYCODE_BACK.
For kernel event system, you need write a service to map BTN_RIGHT to KEY_BACK, then the aosp can always get KEY_BACK event while you click mouse BTN_RIGHT.
Best Regards,
Zhiming
Hi,
This could be done with two different ways: 1. framework layer, 2 kernel event system.
For such remapping on aosp framework, you may need to modify synthesizeButtonKeys function in https://android.googlesource.com/platform/frameworks/base/+/a45746e/services/input/InputReader.cpp, filter the mouse MOUSE_SECONDARY event , mapping it to KEYCODE_BACK.
For kernel event system, you need write a service to map BTN_RIGHT to KEY_BACK, then the aosp can always get KEY_BACK event while you click mouse BTN_RIGHT.
Best Regards,
Zhiming