Two-finger scrolling will cancel whatever action that was currently selected

This commit is contained in:
pelya
2014-06-01 00:29:56 +03:00
parent 7fb35a10ab
commit d2feaa9316

View File

@@ -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 <SDL.h>
#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;
}