android 11鼠标右键返回功能

android 11 鼠标右键返回功能的修改位置和android10,android9不一致,修改如下。
基于RK3568 官方SDK验证。

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;

参考:
android9/10鼠标右键功能

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐