summaryrefslogtreecommitdiff
path: root/src/input/inputmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-15 05:23:23 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-15 05:23:23 +0300
commita6d79e4f323cf0d52b87be93cb193bc8b813a365 (patch)
tree2e1baf7f963ffc6d78a68c3d90cd0d7333fc5476 /src/input/inputmanager.cpp
parentb51f40475dcdf4282eccd3aba9e4e5db034e412f (diff)
downloadmv-a6d79e4f323cf0d52b87be93cb193bc8b813a365.tar.gz
mv-a6d79e4f323cf0d52b87be93cb193bc8b813a365.tar.bz2
mv-a6d79e4f323cf0d52b87be93cb193bc8b813a365.tar.xz
mv-a6d79e4f323cf0d52b87be93cb193bc8b813a365.zip
temporary disable input action types based on key releases.
Diffstat (limited to 'src/input/inputmanager.cpp')
-rw-r--r--src/input/inputmanager.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp
index d141875b8..db0c0c6c5 100644
--- a/src/input/inputmanager.cpp
+++ b/src/input/inputmanager.cpp
@@ -693,7 +693,6 @@ bool InputManager::handleEvent(const SDL_Event &restrict event) restrict2
switch (event.type)
{
case SDL_KEYDOWN:
- case SDL_KEYUP:
if (isActionActive(InputAction::IGNORE_INPUT_1) ||
isActionActive(InputAction::IGNORE_INPUT_2))
{
@@ -707,6 +706,15 @@ bool InputManager::handleEvent(const SDL_Event &restrict event) restrict2
}
break;
+// disabled temporary
+// case SDL_KEYUP:
+// if (triggerAction(keyboard.getActionVector(event)))
+// {
+// BLOCK_END("InputManager::handleEvent")
+// return true;
+// }
+// break;
+
case SDL_JOYBUTTONDOWN:
if ((joystick != nullptr) && joystick->validate())
{
@@ -742,7 +750,7 @@ void InputManager::handleRepeat()
joystick->handleRepeat(time);
}
-void InputManager::updateConditionMask(const bool pressed) restrict2
+void InputManager::updateConditionMask(const bool pressed A_UNUSED) restrict2
{
mMask = 1;
if (keyboard.isEnabled())
@@ -830,10 +838,12 @@ void InputManager::updateConditionMask(const bool pressed) restrict2
{
mMask |= InputCondition::NOTARGET;
}
- if (pressed == true)
- mMask |= InputCondition::KEY_DOWN;
- else
- mMask |= InputCondition::KEY_UP;
+ // enable it temporary
+ mMask |= InputCondition::KEY_DOWN;
+// if (pressed == true)
+// mMask |= InputCondition::KEY_DOWN;
+// else
+// mMask |= InputCondition::KEY_UP;
}
bool InputManager::checkKey(const InputActionData *restrict const key) const