diff --git a/src/video/win32/SDL_win32events.c b/src/video/win32/SDL_win32events.c index 5dcbfa765..682832e05 100644 --- a/src/video/win32/SDL_win32events.c +++ b/src/video/win32/SDL_win32events.c @@ -236,7 +236,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { LPBYTE lpb; const RAWINPUTHEADER *header; - int index; + int index = -1; int i; int size = 0; const RAWMOUSE *raw_mouse = NULL; @@ -261,6 +261,10 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break; } } + if (index < 0) { + /* New mouse? Should we dynamically update mouse list? */ + return (0); + } GetCursorPos(&point); ScreenToClient(hwnd, &point);