20231124給RK3399的挖掘機開發板在Andorid10下加鼠標右鍵返回
2023/11/24 12:19
百度:RK3399 Android10 右鍵返回
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;
參考:
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;
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) {