input minor refactoring

This commit is contained in:
ChancellorIkseew
2025-04-09 02:48:09 +10:00
parent 6bdf7c9719
commit a16c4fcf8b
3 changed files with 8 additions and 9 deletions
+4 -5
View File
@@ -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;
}
}
}