-
Notifications
You must be signed in to change notification settings - Fork 0
/
polycode-no-touch-to-mouse.patch
37 lines (34 loc) · 2.55 KB
/
polycode-no-touch-to-mouse.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff --git a/Core/Contents/Source/PolyWinCore.cpp b/Core/Contents/Source/PolyWinCore.cpp
index 85713dd..1a80d7b 100644
--- a/Core/Contents/Source/PolyWinCore.cpp
+++ b/Core/Contents/Source/PolyWinCore.cpp
@@ -645,7 +645,14 @@ void Win32Core::handleTouchEvent(LPARAM lParam, WPARAM wParam) {
}
#endif
+static bool isMouseEventFromTouchInput() {
+ LPARAM extra = GetMessageExtraInfo();
+ return (extra & 0x80) != 0;
+}
+
void Win32Core::handleMouseMove(LPARAM lParam, WPARAM wParam) {
+ if (isMouseEventFromTouchInput())
+ return;
lockMutex(eventMutex);
Win32Event newEvent;
newEvent.eventGroup = Win32Event::INPUT_EVENT;
@@ -671,6 +678,8 @@ void Win32Core::handleMouseWheel(LPARAM lParam, WPARAM wParam) {
}
void Win32Core::handleMouseDown(int mouseCode,LPARAM lParam, WPARAM wParam) {
+ if (isMouseEventFromTouchInput())
+ return;
lockMutex(eventMutex);
Win32Event newEvent;
newEvent.eventGroup = Win32Event::INPUT_EVENT;
@@ -683,6 +692,8 @@ void Win32Core::handleMouseDown(int mouseCode,LPARAM lParam, WPARAM wParam) {
}
void Win32Core::handleMouseUp(int mouseCode,LPARAM lParam, WPARAM wParam) {
+ if (isMouseEventFromTouchInput())
+ return;
lockMutex(eventMutex);
Win32Event newEvent;
newEvent.eventGroup = Win32Event::INPUT_EVENT;