From a6d79e4f323cf0d52b87be93cb193bc8b813a365 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 15 Sep 2017 05:23:23 +0300 Subject: temporary disable input action types based on key releases. --- src/input/inputmanager.cpp | 22 ++++++++++++++++------ 1 file 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 -- cgit v1.2.3-60-g2f50