Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed mouse focus window reporting

FIXME: Should the window be a parameter to the mouse events again?
  • Loading branch information
slouken committed Jun 17, 2010
1 parent 8340558 commit e16f04a67a626521e329035ad57781f1ac559044
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/video/win32/SDL_win32events.c
11 src/video/win32/SDL_win32events.c 100644 → 100755
@@ -176,23 +176,24 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
returnCode = 0;
break;

case WM_MOUSEMOVE:
case WM_MOUSEMOVE:
SDL_SetMouseFocus(data->window);
SDL_SendMouseMotion(0, LOWORD(lParam), HIWORD(lParam));
break;

case WM_LBUTTONDOWN:
SDL_SetMouseFocus(data->window);
SDL_SendMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT);
break;

case WM_LBUTTONUP:
SDL_SetMouseFocus(data->window);
SDL_SendMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT);
break;

case WM_MOUSELEAVE:
{
if (SDL_GetMouseFocus() == data->window) {
SDL_SetMouseFocus(NULL);
}
if (SDL_GetMouseFocus() == data->window) {
SDL_SetMouseFocus(NULL);
}
returnCode = 0;
break;

0 comments on commit e16f04a

Please sign in to comment.