20231124给RK3399的挖掘机开发板在Andorid10下加鼠标右键返回

20231124给RK3399的挖掘机开发板在Andorid10下加鼠标右键返回
2023/11/24 12:19


百度:RK3399 Android10 右键返回

20231124给RK3399的挖掘机开发板在Andorid10下加鼠标右键返回_第1张图片

https://blog.csdn.net/danhu/article/details/122467256
android9/android10 鼠标右键返回(已验证)
danhu 于 2022-01-13 09:46:42 发布

android10 鼠标右键返回
基于RK3399 官方SDK验证。
android9和android10的修改方法一致,和android11的修改位置不同。
具体修改如下:
Z:\10\frameworks\native\services\inputflinger\InputReader.cpp
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;

20231124给RK3399的挖掘机开发板在Andorid10下加鼠标右键返回_第2张图片

20231124给RK3399的挖掘机开发板在Andorid10下加鼠标右键返回_第3张图片

参考:

https://blog.csdn.net/danhu/article/details/122454155
android11 鼠标右键返回


参考资料:
https://codeleading.com/article/91592662978/
android9 3288 鼠标右键返回
技术标签: rk3288

--- a/frameworks/native/services/inputflinger/InputReader.cpp
+++ b/frameworks/native/services/inputflinger/InputReader.cpp
@@ -1433,13 +1433,7 @@ uint32_t CursorButtonAccumulator::getButtonState() const {
         result |= AMOTION_EVENT_BUTTON_PRIMARY;
     }
     if (mBtnRight) {
-        char targetProduct[PROPERTY_VALUE_MAX] = {0};
-        property_get("ro.target.product", targetProduct, "");
-        if (strcmp(targetProduct, "box") == 0 || strcmp(targetProduct, "atv") == 0) {
             result |= AMOTION_EVENT_BUTTON_BACK;
-        } else {
-            result |= AMOTION_EVENT_BUTTON_SECONDARY;
-        }
     }
     if (mBtnMiddle) {
         result |= AMOTION_EVENT_BUTTON_TERTIARY;

20231124给RK3399的挖掘机开发板在Andorid10下加鼠标右键返回_第4张图片


https://blog.csdn.net/qq_38312843/article/details/125234114
RK3588-android12《鼠标右键改为返回功能》

要不要买菜!
于 2022-06-11 14:07:58 发布

修改:frameworks/native/services/inputflinger/reader/mapper/accumulator/CursorButtonAccumulator.cpp
1
diff --git a/services/inputflinger/reader/mapper/accumulator/CursorButtonAccumulator.cpp b/services/inputflinger/reader/mapper/accumulator/CursorButtonAccumulator.cpp
index 168b0a7..01be174 100644
--- a/services/inputflinger/reader/mapper/accumulator/CursorButtonAccumulator.cpp
+++ b/services/inputflinger/reader/mapper/accumulator/CursorButtonAccumulator.cpp
@@ -110,7 +110,7 @@ uint32_t CursorButtonAccumulator::getButtonState() const {
         if (strcmp(targetProduct, "box") == 0 || strcmp(targetProduct, "atv") == 0) {
             result |= AMOTION_EVENT_BUTTON_BACK;
         } else {
-            result |= AMOTION_EVENT_BUTTON_SECONDARY;
+            result |= AMOTION_EVENT_BUTTON_BACK;
         }
     }
     if (mBtnMiddle) {

你可能感兴趣的:(杂质,杂质)