Skip to content

Commit

Permalink
Ignore synthetic mouse events generated for touchscreens
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cgutman committed Jul 7, 2019
1 parent e841b06 commit 7e09718
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/video/windows/SDL_windowsevents.c
Expand Up @@ -552,8 +552,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)

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) {
RAWMOUSE* rawmouse = &inp.data.mouse;

Expand Down

0 comments on commit 7e09718

Please sign in to comment.