Skip to content

Commit 106ccc7

Browse files
committed
Fixed missing simulated mouse events using a Wacom tablet
The low 16-bits of the message extra info is an event sequence number when using the Wacom tablet with Windows Ink disabled. The high bits of normal mouse motion when using touch input match the touch signature, 0xFF515700. The high bits of raw input mouse motion when using touch input do not match that signature, so we have to check for the touch bit in that case. Fixes #12927
1 parent 8ae962c commit 106ccc7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/video/windows/SDL_windowsevents.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,6 @@ static SDL_MOUSE_EVENT_SOURCE GetMouseMessageSource(ULONG extrainfo)
442442
return SDL_MOUSE_EVENT_SOURCE_PEN;
443443
}
444444
}
445-
/* Sometimes WM_INPUT events won't have the correct touch signature,
446-
so we have to rely purely on the touch bit being set. */
447-
if (SDL_TouchDevicesAvailable() && extrainfo & 0x80) {
448-
return SDL_MOUSE_EVENT_SOURCE_TOUCH;
449-
}
450445
return SDL_MOUSE_EVENT_SOURCE_MOUSE;
451446
}
452447
#endif // !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
@@ -584,7 +579,8 @@ static void WIN_HandleRawMouseInput(Uint64 timestamp, SDL_VideoData *data, HANDL
584579
return;
585580
}
586581

587-
if (GetMouseMessageSource(rawmouse->ulExtraInformation) != SDL_MOUSE_EVENT_SOURCE_MOUSE) {
582+
if (GetMouseMessageSource(rawmouse->ulExtraInformation) != SDL_MOUSE_EVENT_SOURCE_MOUSE ||
583+
(SDL_TouchDevicesAvailable() && (rawmouse->ulExtraInformation & 0x80) == 0x80)) {
588584
return;
589585
}
590586

0 commit comments

Comments
 (0)