summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-08-31 08:16:58 +0200
committerGitHub <noreply@github.com>2018-08-31 08:16:58 +0200
commitf2e52ff915e150e8713b5ff5e7a06c3092e9a04c (patch)
tree4eb8d1979e769dc856c3484e1f348ccaa0c1a908
parent2ba42b709541928aaaa0312077d5b9cacdb696a5 (diff)
parent28019c71a67ff89633f01548dbbd1f4a5ae5a152 (diff)
Merge pull request #21611 from RandomShaper/fix-wacom-input
Fix multitouch input not working on certain devices on Windows
-rw-r--r--platform/windows/os_windows.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 7009df8e57..4ca6f36629 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -249,7 +249,11 @@ bool OS_Windows::can_draw() const {
#define MI_WP_SIGNATURE 0xFF515700
#define SIGNATURE_MASK 0xFFFFFF00
+// Keeping the name suggested by Microsoft, but this macro really answers:
+// Is this mouse event emulated from touch or pen input?
#define IsPenEvent(dw) (((dw)&SIGNATURE_MASK) == MI_WP_SIGNATURE)
+// This one tells whether the event comes from touchscreen (and not from pen)
+#define IsTouchEvent(dw) (IsPenEvent(dw) && ((dw)&0x80))
void OS_Windows::_touch_event(bool p_pressed, float p_x, float p_y, int idx) {
@@ -469,7 +473,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (input->is_emulating_mouse_from_touch()) {
// Universal translation enabled; ignore OS translation
LPARAM extra = GetMessageExtraInfo();
- if (IsPenEvent(extra)) {
+ if (IsTouchEvent(extra)) {
break;
}
}
@@ -560,7 +564,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (input->is_emulating_mouse_from_touch()) {
// Universal translation enabled; ignore OS translations for left button
LPARAM extra = GetMessageExtraInfo();
- if (IsPenEvent(extra)) {
+ if (IsTouchEvent(extra)) {
break;
}
}