鼠标右键不能返回问题
Android9、10:
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:
frameworks/native/services/inputflinger/reader/mapper/accumulator/CursorButtonAccumulator.cpp diff --git a/services/inputflinger/reader/mapper/accumulator/CursorButtonAccumulator.cpp b/services/inputflinger/reader/mapper/accumulator/CursorButtonAccumulator.cpp index 168b0a70b..f03e68f5a 100755 --- a/services/inputflinger/reader/mapper/accumulator/CursorButtonAccumulator.cpp +++ b/services/inputflinger/reader/mapper/accumulator/CursorButtonAccumulator.cpp @@ -107,7 +107,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;