diff --git a/src/common/config.cpp b/src/common/config.cpp index 045fa398c..ac9c5b634 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -756,9 +756,9 @@ touchpad = g; #Transform l1 = rightbutton, lshift; -#Shoot -r1 = leftbutton; #Light attack +r1 = leftbutton; +#Shoot l2 = rightbutton; #Heavy attack r2 = leftbutton, lshift; diff --git a/src/input/input_handler.cpp b/src/input/input_handler.cpp index af2a3be4c..c86b15334 100644 --- a/src/input/input_handler.cpp +++ b/src/input/input_handler.cpp @@ -461,11 +461,10 @@ bool IsInputActive(const InputBinding& i) { // Search for the current key in pressed_keys starting from the last checked position while (pressed_it != pressed_end && pressed_it->first <= key) { if (pressed_it->first == key) { - if (!pressed_it->second) { - key_found = true; - flags_to_set.push_back( - &pressed_it->second); // Collect pointer if flag is not already set - } + + key_found = true; + flags_to_set.push_back(&pressed_it->second); + ++pressed_it; // Move to the next key in pressed_keys break; } @@ -479,7 +478,13 @@ bool IsInputActive(const InputBinding& i) { } } - // Set all flags now that we've verified all keys are active + bool is_fully_blocked = true; + for (bool* flag : flags_to_set) { + is_fully_blocked &= *flag; + } + if(is_fully_blocked) { + return false; + } for (bool* flag : flags_to_set) { *flag = true; }