Skip to content

Commit

Permalink
Don't interpret raw input messages with no mouse position
Browse files Browse the repository at this point in the history
This happens occasionally on touch devices when raw input is enabled
  • Loading branch information
slouken committed Apr 7, 2020
1 parent 0721931 commit 488b94c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/video/windows/SDL_windowsevents.c
Expand Up @@ -609,7 +609,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)

if ((rawmouse->usFlags & 0x01) == MOUSE_MOVE_RELATIVE) {
SDL_SendMouseMotion(data->window, 0, 1, (int)rawmouse->lLastX, (int)rawmouse->lLastY);
} else {
} else if (rawmouse->lLastX || rawmouse->lLastY) {
/* synthesize relative moves from the abs position */
static SDL_Point lastMousePoint;
SDL_bool virtual_desktop = (rawmouse->usFlags & MOUSE_VIRTUAL_DESKTOP) ? SDL_TRUE : SDL_FALSE;
Expand Down

0 comments on commit 488b94c

Please sign in to comment.