mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
input minor refactoring
This commit is contained in:
parent
6bdf7c9719
commit
a16c4fcf8b
3 changed files with 8 additions and 9 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue