Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed mouse focus window reporting
Browse files Browse the repository at this point in the history
FIXME: Should the window be a parameter to the mouse events again?
  • Loading branch information
slouken committed Jun 17, 2010
1 parent 8340558 commit e16f04a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/video/win32/SDL_win32events.c 100644 → 100755
Expand Up @@ -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;
Expand Down

0 comments on commit e16f04a

Please sign in to comment.