Răsfoiți Sursa

Ignore synthetic mouse events generated for touchscreens

Windows generates fake raw mouse events for touchscreens for compatibility
with legacy apps that predate touch support in Windows. We already handle
touch events explicitly, so drop the synthetic events to avoid duplicates.
Cameron Gutman 6 ani în urmă
părinte
comite
7e09718dfe
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      src/video/windows/SDL_windowsevents.c

+ 2 - 2
src/video/windows/SDL_windowsevents.c

@@ -552,8 +552,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
 
             GetRawInputData(hRawInput, RID_INPUT, &inp, &size, sizeof(RAWINPUTHEADER));
             GetRawInputData(hRawInput, RID_INPUT, &inp, &size, sizeof(RAWINPUTHEADER));
 
 
-            /* Mouse data */
-            if (inp.header.dwType == RIM_TYPEMOUSE) {
+            /* Mouse data (ignoring synthetic mouse events generated for touchscreens) */
+            if (inp.header.dwType == RIM_TYPEMOUSE && (GetMessageExtraInfo() & 0x80) == 0) {
                 if (isRelative) {
                 if (isRelative) {
                     RAWMOUSE* rawmouse = &inp.data.mouse;
                     RAWMOUSE* rawmouse = &inp.data.mouse;