mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
change naming
This commit is contained in:
@ -37,7 +37,7 @@ InputHandler::InputHandler()
|
|||||||
: enableMouse(settings["input"]["enableMouse"].Bool())
|
: enableMouse(settings["input"]["enableMouse"].Bool())
|
||||||
, enableTouch(settings["input"]["enableTouch"].Bool())
|
, enableTouch(settings["input"]["enableTouch"].Bool())
|
||||||
, enableController(settings["input"]["enableController"].Bool())
|
, enableController(settings["input"]["enableController"].Bool())
|
||||||
, currentInputMode(InputMode::MOUSE)
|
, currentInputMode(InputMode::KEYBOARD_AND_MOUSE)
|
||||||
, mouseHandler(std::make_unique<InputSourceMouse>())
|
, mouseHandler(std::make_unique<InputSourceMouse>())
|
||||||
, keyboardHandler(std::make_unique<InputSourceKeyboard>())
|
, keyboardHandler(std::make_unique<InputSourceKeyboard>())
|
||||||
, fingerHandler(std::make_unique<InputSourceTouch>())
|
, fingerHandler(std::make_unique<InputSourceTouch>())
|
||||||
@ -53,6 +53,7 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current)
|
|||||||
switch (current.type)
|
switch (current.type)
|
||||||
{
|
{
|
||||||
case SDL_KEYDOWN:
|
case SDL_KEYDOWN:
|
||||||
|
setCurrentInputMode(InputMode::KEYBOARD_AND_MOUSE);
|
||||||
keyboardHandler->handleEventKeyDown(current.key);
|
keyboardHandler->handleEventKeyDown(current.key);
|
||||||
return;
|
return;
|
||||||
case SDL_KEYUP:
|
case SDL_KEYUP:
|
||||||
@ -62,14 +63,14 @@ void InputHandler::handleCurrentEvent(const SDL_Event & current)
|
|||||||
case SDL_MOUSEMOTION:
|
case SDL_MOUSEMOTION:
|
||||||
if (enableMouse)
|
if (enableMouse)
|
||||||
{
|
{
|
||||||
setCurrentInputMode(InputMode::MOUSE);
|
setCurrentInputMode(InputMode::KEYBOARD_AND_MOUSE);
|
||||||
mouseHandler->handleEventMouseMotion(current.motion);
|
mouseHandler->handleEventMouseMotion(current.motion);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
if (enableMouse)
|
if (enableMouse)
|
||||||
{
|
{
|
||||||
setCurrentInputMode(InputMode::MOUSE);
|
setCurrentInputMode(InputMode::KEYBOARD_AND_MOUSE);
|
||||||
mouseHandler->handleEventMouseButtonDown(current.button);
|
mouseHandler->handleEventMouseButtonDown(current.button);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user