diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-12-06 00:43:58 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-12-06 00:43:58 +0100 |
commit | 52b75a02aeeaf2c23f5af32fededf4e5fb24bade (patch) | |
tree | 158d9a60763ce6a149ee12f78bc746a0dc8670fc /opentrack/shortcuts.h | |
parent | 0f577dbe8adb8f7e210241c6bee0be73349f8d45 (diff) |
api, main: implement global shortcuts for controlling tracking
Issue: #252
That involves moving stuff around to get rid of circular dependencies.
You need to bind keys to shortcuts again this once.
Diffstat (limited to 'opentrack/shortcuts.h')
-rw-r--r-- | opentrack/shortcuts.h | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/opentrack/shortcuts.h b/opentrack/shortcuts.h index 4dec7c2c..f8343ad8 100644 --- a/opentrack/shortcuts.h +++ b/opentrack/shortcuts.h @@ -46,31 +46,6 @@ public: #ifdef _WIN32 KeybindingWorker::Token key_token; #endif - - struct key_opts { - value<QString> keycode, guid; - value<int> button; - - key_opts(pbundle b, const QString& name) : - keycode(b, QString("keycode-%1").arg(name), ""), - guid(b, QString("guid-%1").arg(name), ""), - button(b, QString("button-%1").arg(name), -1) - {} - }; - - struct settings : opts { - key_opts center, toggle, zero, start_tracking, stop_tracking, toggle_tracking; - main_settings s_main; - settings() : - opts("keyboard-shortcuts"), - center(b, "center"), - toggle(b, "toggle"), - zero(b, "zero"), - start_tracking(b, "start-tracking"), - stop_tracking(b, "stop-tracking"), - toggle_tracking(b, "toggle-tracking") - {} - } s; Shortcuts() : #ifdef _WIN32 @@ -78,7 +53,7 @@ public: #endif {} - void reload(const std::vector<std::tuple<Shortcuts::key_opts &, Shortcuts::fun> > &keys); + void reload(const std::vector<std::tuple<key_opts &, fun> > &keys); private: void bind_keyboard_shortcut(K &key, const key_opts& k); #ifdef _WIN32 |