From aa58a960b92cf9c359aa61e19808c11d49fd7b65 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 2 Oct 2015 08:38:53 +0200 Subject: shortcuts: use our own timer, other one is thread-bound --- opentrack/shortcuts.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'opentrack/shortcuts.h') 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 #include -#include +#include "opentrack-compat/timer.hpp" #include #include #include @@ -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 -- cgit v1.2.3