win32 and SDL2: capture the mouse when the button is pressed

This commit is contained in:
Thomas Bernard
2019-02-04 18:41:33 +01:00
parent cb315e4f0c
commit b184a75c9e
2 changed files with 14 additions and 1 deletions

View File

@@ -1299,11 +1299,17 @@ int Get_input(int sleep_time)
break;
case SDL_MOUSEBUTTONDOWN:
#ifdef USE_SDL2
SDL_CaptureMouse(SDL_TRUE);
#endif
Handle_mouse_click(&event.button);
user_feedback_required = 1;
break;
case SDL_MOUSEBUTTONUP:
#ifdef USE_SDL2
SDL_CaptureMouse(SDL_FALSE);
#endif
Handle_mouse_release(&event.button);
user_feedback_required = 1;
break;