diff --git a/src/window/detail/GLFWWindow.cpp b/src/window/detail/GLFWWindow.cpp index 7349dced..2c648887 100644 --- a/src/window/detail/GLFWWindow.cpp +++ b/src/window/detail/GLFWWindow.cpp @@ -186,13 +186,12 @@ public: pressedKeys.clear(); glfwPollEvents(); - for (auto& entry : bindings.getAll()) { - auto& binding = entry.second; + for (auto& [_, binding] : bindings.getAll()) { if (!binding.enabled) { binding.state = false; continue; } - binding.justChange = false; + binding.justChanged = false; bool newstate = false; switch (binding.type) { @@ -207,13 +206,13 @@ public: if (newstate) { if (!binding.state) { binding.state = true; - binding.justChange = true; + binding.justChanged = true; binding.onactived.notify(); } } else { if (binding.state) { binding.state = false; - binding.justChange = true; + binding.justChanged = true; } } } diff --git a/src/window/input.cpp b/src/window/input.cpp index dfb769db..6feaddb3 100644 --- a/src/window/input.cpp +++ b/src/window/input.cpp @@ -57,7 +57,7 @@ static std::unordered_map keynames {}; static std::unordered_map buttonsnames{}; std::string input_util::get_name(Mousecode code) { - auto found = buttonsnames.find(static_cast(code)); + const auto found = buttonsnames.find(static_cast(code)); if (found == buttonsnames.end()) { return "unknown"; } @@ -65,7 +65,7 @@ std::string input_util::get_name(Mousecode code) { } std::string input_util::get_name(Keycode code) { - auto found = keynames.find(static_cast(code)); + const auto found = keynames.find(static_cast(code)); if (found == keynames.end()) { return "unknown"; } diff --git a/src/window/input.hpp b/src/window/input.hpp index d5b9efb8..0880ca88 100644 --- a/src/window/input.hpp +++ b/src/window/input.hpp @@ -158,7 +158,7 @@ struct Binding { InputType type; int code; bool state = false; - bool justChange = false; + bool justChanged = false; bool enabled = true; Binding() = default; @@ -170,7 +170,7 @@ struct Binding { } bool jactive() const { - return state && justChange; + return state && justChanged; } void reset(InputType, int);