SDL 1.2.x: capture mouse when button is pressed as well

This commit is contained in:
Thomas Bernard 2019-02-08 10:23:20 +01:00
parent 73f5f1d214
commit 546a6fecd2
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C

View File

@ -1305,6 +1305,8 @@ int Get_input(int sleep_time)
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
#ifdef USE_SDL2 #ifdef USE_SDL2
SDL_CaptureMouse(SDL_TRUE); SDL_CaptureMouse(SDL_TRUE);
#else
SDL_WM_GrabInput(SDL_GRAB_ON);
#endif #endif
Handle_mouse_click(&event.button); Handle_mouse_click(&event.button);
user_feedback_required = 1; user_feedback_required = 1;
@ -1313,6 +1315,8 @@ int Get_input(int sleep_time)
case SDL_MOUSEBUTTONUP: case SDL_MOUSEBUTTONUP:
#ifdef USE_SDL2 #ifdef USE_SDL2
SDL_CaptureMouse(SDL_FALSE); SDL_CaptureMouse(SDL_FALSE);
#else
SDL_WM_GrabInput(SDL_GRAB_OFF);
#endif #endif
Handle_mouse_release(&event.button); Handle_mouse_release(&event.button);
user_feedback_required = 1; user_feedback_required = 1;