From 546a6fecd2e29fba80f2c1f6fb84fe403a7e3dc4 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Fri, 8 Feb 2019 10:23:20 +0100 Subject: [PATCH] SDL 1.2.x: capture mouse when button is pressed as well --- src/input.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/input.c b/src/input.c index 8709ed3d..f3a634b4 100644 --- a/src/input.c +++ b/src/input.c @@ -1305,6 +1305,8 @@ int Get_input(int sleep_time) case SDL_MOUSEBUTTONDOWN: #ifdef USE_SDL2 SDL_CaptureMouse(SDL_TRUE); +#else + SDL_WM_GrabInput(SDL_GRAB_ON); #endif Handle_mouse_click(&event.button); user_feedback_required = 1; @@ -1313,6 +1315,8 @@ int Get_input(int sleep_time) case SDL_MOUSEBUTTONUP: #ifdef USE_SDL2 SDL_CaptureMouse(SDL_FALSE); +#else + SDL_WM_GrabInput(SDL_GRAB_OFF); #endif Handle_mouse_release(&event.button); user_feedback_required = 1;