Android12 changes the right mouse button to return function

Note: This modification is for mouse response when plugged into the device.

path:

frameworks/native/services/inputflinger/reader/mapper/accumulator/CursorButtonAccumulator.cpp

Modify patch:

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) {
   
   

 

Guess you like

Origin blog.csdn.net/guanmingyuangmy/article/details/130290236