1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

click also change of modi; haptic only with touch

This commit is contained in:
Laserlicht 2024-07-19 03:16:56 +02:00
parent 5dae5ed30e
commit 76fc821f82
2 changed files with 12 additions and 1 deletions

View File

@ -499,6 +499,7 @@ void QuickSpellPanel::show(Canvas & to)
void QuickSpellPanel::inputModiChanged(InputModi modi)
{
create();
redraw();
}
HeroInfoBasicPanel::HeroInfoBasicPanel(const InfoAboutHero & hero, Point * position, bool initializeBackground)

View File

@ -68,7 +68,10 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current)
return;
case SDL_MOUSEBUTTONDOWN:
if (enableMouse)
{
setCurrentInputModi(InputModi::MOUSE);
mouseHandler->handleEventMouseButtonDown(current.button);
}
return;
case SDL_MOUSEBUTTONUP:
if (enableMouse)
@ -94,7 +97,10 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current)
return;
case SDL_FINGERDOWN:
if (enableTouch)
{
setCurrentInputModi(InputModi::TOUCH);
fingerHandler->handleEventFingerDown(current.tfinger);
}
return;
case SDL_FINGERUP:
if (enableTouch)
@ -109,7 +115,10 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current)
return;
case SDL_CONTROLLERBUTTONDOWN:
if (enableController)
{
setCurrentInputModi(InputModi::CONTROLLER);
gameControllerHandler->handleEventButtonDown(current.cbutton);
}
return;
case SDL_CONTROLLERBUTTONUP:
if (enableController)
@ -357,6 +366,7 @@ void InputHandler::stopTextInput()
void InputHandler::hapticFeedback()
{
if(currentInputModi == InputModi::TOUCH)
fingerHandler->hapticFeedback();
}