Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_win32events.c @ 4470:a5878b271b74
Fixed mouse focus window reporting
FIXME: Should the window be a parameter to the mouse events again?
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 17 Jun 2010 12:33:05 -0700 |
parents | 3e69e077cb95 |
children | 9322f7db8603 |
comparison
equal
deleted
inserted
replaced
4469:f67139f6d87f | 4470:a5878b271b74 |
---|---|
174 } | 174 } |
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(0, LOWORD(lParam), HIWORD(lParam)); | 181 SDL_SendMouseMotion(0, LOWORD(lParam), HIWORD(lParam)); |
181 break; | 182 break; |
182 | 183 |
183 case WM_LBUTTONDOWN: | 184 case WM_LBUTTONDOWN: |
185 SDL_SetMouseFocus(data->window); | |
184 SDL_SendMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT); | 186 SDL_SendMouseButton(SDL_PRESSED, SDL_BUTTON_LEFT); |
185 break; | 187 break; |
186 | 188 |
187 case WM_LBUTTONUP: | 189 case WM_LBUTTONUP: |
190 SDL_SetMouseFocus(data->window); | |
188 SDL_SendMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT); | 191 SDL_SendMouseButton(SDL_RELEASED, SDL_BUTTON_LEFT); |
189 break; | 192 break; |
190 | 193 |
191 case WM_MOUSELEAVE: | 194 case WM_MOUSELEAVE: |
192 { | 195 if (SDL_GetMouseFocus() == data->window) { |
193 if (SDL_GetMouseFocus() == data->window) { | 196 SDL_SetMouseFocus(NULL); |
194 SDL_SetMouseFocus(NULL); | |
195 } | |
196 } | 197 } |
197 returnCode = 0; | 198 returnCode = 0; |
198 break; | 199 break; |
199 | 200 |
200 case WM_SYSKEYDOWN: | 201 case WM_SYSKEYDOWN: |