diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-02 08:38:53 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-10-02 08:38:53 +0200 |
commit | aa58a960b92cf9c359aa61e19808c11d49fd7b65 (patch) | |
tree | 91a36b0146ef877c839bbe7b3a1f284ac5f4f5a5 /opentrack/shortcuts.h | |
parent | 79815a8a759ae9fc48c26ee16bc3337463c35655 (diff) |
shortcuts: use our own timer, other one is thread-bound
Diffstat (limited to 'opentrack/shortcuts.h')
-rw-r--r-- | opentrack/shortcuts.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/opentrack/shortcuts.h b/opentrack/shortcuts.h index 8877b5bb..576b5384 100644 --- a/opentrack/shortcuts.h +++ b/opentrack/shortcuts.h @@ -9,7 +9,7 @@ #pragma once #include <QObject> #include <QWidget> -#include <QElapsedTimer> +#include "opentrack-compat/timer.hpp" #include <QThread> #include <QMessageBox> #include <QCheckBox> @@ -46,7 +46,7 @@ struct Key { bool shift; bool ctrl; bool alt; - QElapsedTimer timer; + Timer timer; public: Key() : keycode(0), shift(false), ctrl(false), alt(false) { @@ -54,7 +54,9 @@ public: bool should_process() { - return !timer.isValid() ? (timer.start(), true) : timer.restart() > 100; + bool ret = timer.elapsed_ms() > 100; + timer.start(); + return ret; } }; #else |