summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-02 08:38:53 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-10-02 08:38:53 +0200
commitaa58a960b92cf9c359aa61e19808c11d49fd7b65 (patch)
tree91a36b0146ef877c839bbe7b3a1f284ac5f4f5a5
parent79815a8a759ae9fc48c26ee16bc3337463c35655 (diff)
shortcuts: use our own timer, other one is thread-bound
-rw-r--r--opentrack/shortcuts.h8
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