mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Merge pull request #2396 from Laserlicht/haptic-radial
haptic feedback on radial menu action
This commit is contained in:
commit
d0b2bdf0f4
@ -239,6 +239,11 @@ void InputHandler::stopTextInput()
|
||||
textHandler->stopTextInput();
|
||||
}
|
||||
|
||||
void InputHandler::hapticFeedback()
|
||||
{
|
||||
fingerHandler->hapticFeedback();
|
||||
}
|
||||
|
||||
bool InputHandler::hasTouchInputDevice() const
|
||||
{
|
||||
return fingerHandler->hasTouchInputDevice();
|
||||
|
@ -63,6 +63,9 @@ public:
|
||||
/// Ends any existing text input state
|
||||
void stopTextInput();
|
||||
|
||||
/// do a haptic feedback
|
||||
void hapticFeedback();
|
||||
|
||||
/// returns true if system has active touchscreen
|
||||
bool hasTouchInputDevice() const;
|
||||
|
||||
|
@ -96,8 +96,6 @@ class InputSourceTouch
|
||||
|
||||
void emitPanningEvent(const SDL_TouchFingerEvent & tfinger);
|
||||
void emitPinchEvent(const SDL_TouchFingerEvent & tfinger);
|
||||
|
||||
void hapticFeedback();
|
||||
|
||||
public:
|
||||
InputSourceTouch();
|
||||
@ -106,6 +104,8 @@ public:
|
||||
void handleEventFingerDown(const SDL_TouchFingerEvent & current);
|
||||
void handleEventFingerUp(const SDL_TouchFingerEvent & current);
|
||||
|
||||
void hapticFeedback();
|
||||
|
||||
void handleUpdate();
|
||||
|
||||
bool hasTouchInputDevice() const;
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "Images.h"
|
||||
#include "TextControls.h"
|
||||
|
||||
#include "../eventsSDL/InputHandler.h"
|
||||
#include "../gui/CGuiHandler.h"
|
||||
#include "../gui/WindowHandler.h"
|
||||
#include "../render/IImage.h"
|
||||
@ -137,5 +138,8 @@ void RadialMenu::gesture(bool on, const Point & initialPosition, const Point & f
|
||||
// we need to close this window first so if action spawns a new window it won't be closed instead
|
||||
GH.windows().popWindows(1);
|
||||
if (item)
|
||||
{
|
||||
GH.input().hapticFeedback();
|
||||
item->callback();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user