summaryrefslogtreecommitdiffhomepage
path: root/opentrack/shortcuts.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-26 07:10:49 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-10-26 07:10:49 +0100
commit20f83ad3149237087d2d0a81a27e6d511a5e7973 (patch)
tree3aaf2bc964a026292451efaa553744165d3e1c93 /opentrack/shortcuts.cpp
parenta815d8dfe1b452e0cab9b588a9d4ec4650a5bdda (diff)
parent8f7e5c0441237a9c8c187f24a424f6c77c5e397e (diff)
Merge branch 'unstable' into trackhat
* unstable: main: use camera-based centering by default settings: clarify center method usage accela: fix typo win32: try win_key with modifier first shortcuts: remove obsolete code on win32 shortcuts: allow for numpad on win32 qfc: drop nan check pt: drop nan check shortcuts: allow for numlock on win32 accela: remove too many nan checks timer: guard against overflow on win32 accela: remove "done" logic timer: sprinkle some const shortcuts: allow for binding same key to multiple functions qfc: guard against unlikely division by zero cmake: update toolchain file
Diffstat (limited to 'opentrack/shortcuts.cpp')
-rw-r--r--opentrack/shortcuts.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/opentrack/shortcuts.cpp b/opentrack/shortcuts.cpp
index 91480d16..91d449f1 100644
--- a/opentrack/shortcuts.cpp
+++ b/opentrack/shortcuts.cpp
@@ -154,21 +154,21 @@ void Shortcuts::bind_keyboard_shortcut(K &key, key_opts& k)
void Shortcuts::receiver(Key &k)
{
std::vector<K*> ks { &keyCenter, &keyToggle, &keyZero };
- for (auto& k_ : ks)
+ for (K* k_ : ks)
{
if (k.keycode != k_->keycode)
continue;
if (!k_->should_process())
- return;
- if (k_->alt && !k.alt) return;
- if (k_->ctrl && !k.ctrl) return;
- if (k_->shift && !k.shift) return;
-
- if (k.keycode == keyCenter.keycode)
+ continue;
+ if (k_->alt && !k.alt) continue;
+ if (k_->ctrl && !k.ctrl) continue;
+ if (k_->shift && !k.shift) continue;
+
+ if (k_ == &keyCenter)
emit center();
- else if (k.keycode == keyToggle.keycode)
+ else if (k_ == &keyToggle)
emit toggle();
- else if (k.keycode == keyZero.keycode)
+ else if (k_ == &keyZero)
emit zero();
}
}