From d2feaa93166a55305576e83ad8feb309e78fa53d Mon Sep 17 00:00:00 2001 From: pelya Date: Sun, 1 Jun 2014 00:29:56 +0300 Subject: [PATCH] Two-finger scrolling will cancel whatever action that was currently selected --- src/video/sdl_v.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index c5d505a1f6..c20cac2cfa 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -24,6 +24,7 @@ #include "../core/math_func.hpp" #include "../fileio_func.h" #include "../settings_type.h" +#include "../tilehighlight_func.h" #include "sdl_v.h" #include #ifdef __ANDROID__ @@ -603,6 +604,13 @@ int VideoDriver_SDL::PollEvent() } else if (ev.button.button == SDL_BUTTON_LEFT) { _left_button_down = false; _left_button_clicked = false; +#ifdef __ANDROID__ + if (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_RMASK) { + // Two-finger click - hacky way to determine if the right mouse button is already pressed without processing the left button event + // Cancel whatewer action we were doing, to allow two finger scrolling + ResetObjectToPlace(); + } +#endif } else if (ev.button.button == SDL_BUTTON_RIGHT) { _right_button_down = false; }