Firefly开源社区

打印 上一主题 下一主题

RK3288实现TP双屏触摸

80

积分

0

威望

0

贡献

技术小白

积分
80

RK3288实现TP双屏触摸

发表于 2017-7-10 14:16:58      浏览:9286 | 回复:3        打印      只看该作者   [复制链接] 楼主
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp
old mode 100644
new mode 100755
index 4d70d5f..5325bd5
--- a/services/input/EventHub.cpp
+++ b/services/input/EventHub.cpp
@@ -999,7 +999,7 @@ static const int32_t GAMEPAD_KEYCODES[] = {

status_t EventHub::openDeviceLocked(const char *devicePath) {
     char buffer[80];
-
+    static int  TouchDevDisplayID = 1;
     ALOGV("Opening device: %s", devicePath);

     int fd = open(devicePath, O_RDWR | O_CLOEXEC);
@@ -1132,6 +1132,11 @@ status_t EventHub::openDeviceLocked(const char *devicePath) {
         // a touch screen.
         if (test_bit(BTN_TOUCH, device->keyBitmask) || !haveGamepadButtons) {
             device->classes |= INPUT_DEVICE_CLASS_TOUCH | INPUT_DEVICE_CLASS_TOUCH_MT;
+            if(TouchDevDisplayID == 1){               
+                device->classes |= INPUT_DEVICE_CLASS_EXTERNAL;
+                ALOGD(" %d  name:       \"%s\"\n",__LINE__, device->identifier.name.string());
+                TouchDevDisplayID = 0;
+            }   
         }
     // Is this an old style single-touch driver?
     } else if (test_bit(BTN_TOUCH, device->keyBitmask)
diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp
index 8d89fcb..b35e497 100755
--- a/services/input/InputDispatcher.cpp
+++ b/services/input/InputDispatcher.cpp
@@ -829,6 +829,7 @@ void InputDispatcher::logOutboundKeyDetailsLocked(const char* prefix, const KeyE
bool InputDispatcher::dispatchMotionLocked(
         nsecs_t currentTime, MotionEntry* entry, DropReason* dropReason, nsecs_t* nextWakeupTime) {
     // Preprocessing.
+   
     if (! entry->dispatchInProgress) {
         entry->dispatchInProgress = true;

@@ -891,9 +892,9 @@ bool InputDispatcher::dispatchMotionLocked(
     }

     // TODO: support sending secondary display events to input monitors
-    if (isMainDisplay(entry->displayId)) {
+   // if (isMainDisplay(entry->displayId)) {
         addMonitoringTargetsLocked(inputTargets);
-    }
+  //  }

     // Dispatch the motion.
     if (conflictingPointerActions) {
@@ -911,13 +912,13 @@ void InputDispatcher::logOutboundMotionDetailsLocked(const char* prefix, const M
     ALOGD("%seventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, "
             "action=0x%x, flags=0x%x, "
             "metaState=0x%x, buttonState=0x%x, "
-            "edgeFlags=0x%x, xPrecision=%f, yPrecision=%f, downTime=%lld",
+            "edgeFlags=0x%x, xPrecision=%f, yPrecision=%f, downTime=%lld,displayId = %d",
             prefix,
             entry->eventTime, entry->deviceId, entry->source, entry->policyFlags,
             entry->action, entry->flags,
             entry->metaState, entry->buttonState,
             entry->edgeFlags, entry->xPrecision, entry->yPrecision,
-            entry->downTime);
+            entry->downTime,entry->displayId);

     for (uint32_t i = 0; i < entry->pointerCount; i++) {
         ALOGD("  Pointer %d: id=%d, toolType=%d, "
@@ -1141,8 +1142,8 @@ Unresponsive:
             injectionResult, timeSpentWaitingForApplication);
#if DEBUG_FOCUS
     ALOGD("findFocusedWindow finished: injectionResult=%d, "
-            "timeSpentWaitingForApplication=%0.1fms",
-            injectionResult, timeSpentWaitingForApplication / 1000000.0);
+            "timeSpentWaitingForApplication=%0.1fms,mFocusedWindowHandle->name = %s",
+            injectionResult, timeSpentWaitingForApplication / 1000000.0,mFocusedWindowHandle->getName().string());
#endif
     return injectionResult;
}
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp
old mode 100644
new mode 100755
diff --git a/services/java/com/android/server/input/InputWindowHandle.java b/services/java/com/android/server/input/InputWindowHandle.java
index 2903779..cee8733 100755
--- a/services/java/com/android/server/input/InputWindowHandle.java
+++ b/services/java/com/android/server/input/InputWindowHandle.java
@@ -92,7 +92,8 @@ public final class InputWindowHandle {
     public int inputFeatures;

     // Display this input is on.
-    public final int displayId;
+    //public final int displayId;
+    public  int displayId;

     private native void nativeDispose();

diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index c587da0..529af5f 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -13215,6 +13215,7 @@ if(mCurConfiguration.enableMultiWindow()){
                                if(mGroupId == groupId){
                                        windows.remove(win);
                                        win.mDisplayContent = secondDisplayContent;
+                                                  win.mInputWindowHandle.displayId = displayId;                     
                                        if(win.mWinAnimator != null){
                                                int layerStack = secondDisplayContent.getDisplay().getLayerStack();
                                                if(win.mWinAnimator.mSurfaceControl!= null){
回复

使用道具 举报

1570

积分

3

威望

0

贡献

中级创客

Rank: 4

积分
1570

突出贡献

QQ
发表于 2017-7-10 15:51:59        只看该作者  沙发
赞一个,有机会试试
回复

使用道具 举报

124

积分

0

威望

0

贡献

技术小白

积分
124

突出贡献

发表于 2017-7-10 15:56:52        只看该作者  板凳
佩服。先马后看。
回复

使用道具 举报

102

积分

0

威望

0

贡献

技术小白

积分
102
发表于 2017-7-28 16:23:46        只看该作者  地板
楼主可以研究下双USB异触,I2c和USB异触
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表