comparison src/video/win32/SDL_win32events.c @ 4484:9322f7db8603

Cleaned up the mouse window focus handling: you always pass in the relative window when sending a mouse event. Fixed a bug where only mouse wheel up was sent on Mac OS X Fixed a bug where mouse window focus was getting hosed by the fullscreen mouse code on Mac OS X
author Sam Lantinga <slouken@libsdl.org>
date Mon, 05 Jul 2010 22:48:13 -0700
parents a5878b271b74
children eff4e88cc1e8 0c39b36dd104
comparison
equal deleted inserted replaced
4483:539f3eca8798 4484:9322f7db8603
175 } 175 }
176 returnCode = 0; 176 returnCode = 0;
177 break; 177 break;
178 178
179 case WM_MOUSEMOVE: 179 case WM_MOUSEMOVE:
180 SDL_SetMouseFocus(data->window); 180 SDL_SendMouseMotion(data->window, 0, LOWORD(lParam), HIWORD(lParam));
181 SDL_SendMouseMotion(0, LOWORD(lParam), HIWORD(lParam));
182 break; 181 break;
183 182
184 case WM_LBUTTONDOWN: 183 case WM_LBUTTONDOWN:
185 SDL_SetMouseFocus(data->window); 184 SDL_SendMouseButton(data->window, SDL_PRESSED, SDL_BUTTON_LEFT);
186 SDL_SendMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT);
187 break; 185 break;
188 186
189 case WM_LBUTTONUP: 187 case WM_LBUTTONUP:
190 SDL_SetMouseFocus(data->window); 188 SDL_SendMouseButton(data->window, SDL_RELEASED, SDL_BUTTON_LEFT);
191 SDL_SendMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT);
192 break; 189 break;
193 190
194 case WM_MOUSELEAVE: 191 case WM_MOUSELEAVE:
195 if (SDL_GetMouseFocus() == data->window) { 192 if (SDL_GetMouseFocus() == data->window) {
196 SDL_SetMouseFocus(NULL); 193 SDL_SetMouseFocus(NULL);