Fixed mouse focus window reporting
FIXME: Should the window be a parameter to the mouse events again?
This commit is contained in:
parent
82f6deccfd
commit
8840de14d1
1 changed files with 6 additions and 5 deletions
11
src/video/win32/SDL_win32events.c
Normal file → Executable file
11
src/video/win32/SDL_win32events.c
Normal file → Executable file
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue