android10 鼠标右键返回
基于RK3399 官方SDK验证。
android9和android10的修改方法一致,和android11的修改位置不同。
具体修改如下:
frameworks/native/services/inputflinger/InputReader.cpp
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp
index 8a66fc735a..d5e69289da 100755
--- a/services/inputflinger/InputReader.cpp
+++ b/services/inputflinger/InputReader.cpp
@@ -1377,7 +1377,7 @@ uint32_t CursorButtonAccumulator::getButtonState() const {
if (mBtnRight) {
char targetProduct[PROPERTY_VALUE_MAX] = {0};
property_get("ro.target.product", targetProduct, "");
- if (strcmp(targetProduct, "box") == 0 || strcmp(targetProduct, "atv") == 0) {
+ if (strcmp(targetProduct, "box") == 0 || strcmp(targetProduct, "atv") == 0 || strcmp(targetProduct,"tablet") == 0) {
result |= AMOTION_EVENT_BUTTON_BACK;
} else {
result |= AMOTION_EVENT_BUTTON_SECONDARY;
参考:
android11 鼠标右键返回

本文介绍如何在Android 10系统中实现鼠标右键返回功能。基于RK3399官方SDK验证,适用于Android 9及10,并提供InputReader.cpp文件的具体修改对比。此方法不适用于Android 11。
1949

被折叠的 条评论
为什么被折叠?



