mirror of
https://github.com/vcmi/vcmi.git
synced 2025-05-13 22:06:58 +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();
|
textHandler->stopTextInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InputHandler::hapticFeedback()
|
||||||
|
{
|
||||||
|
fingerHandler->hapticFeedback();
|
||||||
|
}
|
||||||
|
|
||||||
bool InputHandler::hasTouchInputDevice() const
|
bool InputHandler::hasTouchInputDevice() const
|
||||||
{
|
{
|
||||||
return fingerHandler->hasTouchInputDevice();
|
return fingerHandler->hasTouchInputDevice();
|
||||||
|
@ -63,6 +63,9 @@ public:
|
|||||||
/// Ends any existing text input state
|
/// Ends any existing text input state
|
||||||
void stopTextInput();
|
void stopTextInput();
|
||||||
|
|
||||||
|
/// do a haptic feedback
|
||||||
|
void hapticFeedback();
|
||||||
|
|
||||||
/// returns true if system has active touchscreen
|
/// returns true if system has active touchscreen
|
||||||
bool hasTouchInputDevice() const;
|
bool hasTouchInputDevice() const;
|
||||||
|
|
||||||
|
@ -97,8 +97,6 @@ class InputSourceTouch
|
|||||||
void emitPanningEvent(const SDL_TouchFingerEvent & tfinger);
|
void emitPanningEvent(const SDL_TouchFingerEvent & tfinger);
|
||||||
void emitPinchEvent(const SDL_TouchFingerEvent & tfinger);
|
void emitPinchEvent(const SDL_TouchFingerEvent & tfinger);
|
||||||
|
|
||||||
void hapticFeedback();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
InputSourceTouch();
|
InputSourceTouch();
|
||||||
|
|
||||||
@ -106,6 +104,8 @@ public:
|
|||||||
void handleEventFingerDown(const SDL_TouchFingerEvent & current);
|
void handleEventFingerDown(const SDL_TouchFingerEvent & current);
|
||||||
void handleEventFingerUp(const SDL_TouchFingerEvent & current);
|
void handleEventFingerUp(const SDL_TouchFingerEvent & current);
|
||||||
|
|
||||||
|
void hapticFeedback();
|
||||||
|
|
||||||
void handleUpdate();
|
void handleUpdate();
|
||||||
|
|
||||||
bool hasTouchInputDevice() const;
|
bool hasTouchInputDevice() const;
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "Images.h"
|
#include "Images.h"
|
||||||
#include "TextControls.h"
|
#include "TextControls.h"
|
||||||
|
|
||||||
|
#include "../eventsSDL/InputHandler.h"
|
||||||
#include "../gui/CGuiHandler.h"
|
#include "../gui/CGuiHandler.h"
|
||||||
#include "../gui/WindowHandler.h"
|
#include "../gui/WindowHandler.h"
|
||||||
#include "../render/IImage.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
|
// we need to close this window first so if action spawns a new window it won't be closed instead
|
||||||
GH.windows().popWindows(1);
|
GH.windows().popWindows(1);
|
||||||
if (item)
|
if (item)
|
||||||
|
{
|
||||||
|
GH.input().hapticFeedback();
|
||||||
item->callback();
|
item->callback();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user