input minor refactoring
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user