diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-11-05 15:24:20 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-11-05 14:24:38 +0000 |
commit | 445eeab7b7f0155a9a52e8bfa5ee8d030151386e (patch) | |
tree | bb865ada67e4a93b4d104b8ab3104ee9267e8161 /variant/trackmouse | |
parent | 29bea6f9b2166bf3e50815d84aff3535705f6b9b (diff) |
trackmouse: fix toggle tracker shortcut
Diffstat (limited to 'variant/trackmouse')
-rw-r--r-- | variant/trackmouse/window.cpp | 11 | ||||
-rw-r--r-- | variant/trackmouse/window.hpp | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/variant/trackmouse/window.cpp b/variant/trackmouse/window.cpp index 1cda0694..a1160c50 100644 --- a/variant/trackmouse/window.cpp +++ b/variant/trackmouse/window.cpp @@ -80,6 +80,10 @@ main_window::main_window() : State(OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH) this, [&] { qDebug() << "stop tracker"; stop_tracker_(); }, Qt::QueuedConnection); + connect(this, &main_window::toggle_tracker, + this, [&] { qDebug() << "toggle tracker"; toggle_tracker_(); }, + Qt::QueuedConnection); + connect(ui.btnStartTracker, SIGNAL(clicked()), this, SLOT(start_tracker_())); connect(ui.btnStopTracker, SIGNAL(clicked()), this, SLOT(stop_tracker_())); @@ -132,7 +136,7 @@ main_window::main_window() : State(OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH) void main_window::register_shortcuts() { global_shortcuts.reload({ - { s.key_toggle_tracking1, [this](bool) { main_window::toggle_tracker_(); }, true }, + { s.key_toggle_tracking1, [this](bool) { main_window::toggle_tracker(); }, true }, }); if (work) @@ -372,8 +376,9 @@ void main_window::set_profile_in_registry() void main_window::toggle_tracker_() { + qDebug() << "toggle tracker"; if (work) - stop_tracker(); + stop_tracker_(); else - start_tracker(); + start_tracker_(); } diff --git a/variant/trackmouse/window.hpp b/variant/trackmouse/window.hpp index b62ae2dd..fd5d5f44 100644 --- a/variant/trackmouse/window.hpp +++ b/variant/trackmouse/window.hpp @@ -86,6 +86,7 @@ private slots: signals: void start_tracker(); void stop_tracker(); + void toggle_tracker(); public: main_window(); |