1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Implemented panning/swiping gesture for sliders

This commit is contained in:
Ivan Savenko
2023-05-29 13:08:08 +03:00
parent 2a30eccb2d
commit 360bf48031
21 changed files with 180 additions and 71 deletions

View File

@@ -47,6 +47,9 @@ void InputSourceMouse::handleEventMouseButtonDown(const SDL_MouseButtonEvent & b
case SDL_BUTTON_RIGHT:
GH.events().dispatchMouseButtonPressed(MouseButton::RIGHT, position);
break;
case SDL_BUTTON_MIDDLE:
GH.events().dispatchGesturePanningStarted(position);
break;
}
}
@@ -67,6 +70,9 @@ void InputSourceMouse::handleEventMouseButtonUp(const SDL_MouseButtonEvent & but
case SDL_BUTTON_RIGHT:
GH.events().dispatchMouseButtonReleased(MouseButton::RIGHT, position);
break;
case SDL_BUTTON_MIDDLE:
GH.events().dispatchGesturePanningEnded();
break;
}
}