summaryrefslogtreecommitdiffhomepage
path: root/opentrack/main-settings.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-12-06 00:43:58 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-12-06 00:43:58 +0100
commit52b75a02aeeaf2c23f5af32fededf4e5fb24bade (patch)
tree158d9a60763ce6a149ee12f78bc746a0dc8670fc /opentrack/main-settings.hpp
parent0f577dbe8adb8f7e210241c6bee0be73349f8d45 (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/main-settings.hpp')
-rw-r--r--opentrack/main-settings.hpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/opentrack/main-settings.hpp b/opentrack/main-settings.hpp
index b7b086ad..793c52f7 100644
--- a/opentrack/main-settings.hpp
+++ b/opentrack/main-settings.hpp
@@ -32,7 +32,18 @@ private:
}
};
-struct main_settings : opts {
+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 main_settings : opts {
value<QString> tracker_dll, filter_dll, protocol_dll;
axis_opts a_x, a_y, a_z, a_yaw, a_pitch, a_roll;
value<bool> tcomp_p, tcomp_tz;
@@ -40,6 +51,8 @@ struct main_settings : opts {
value<int> camera_yaw, camera_pitch, camera_roll;
value<bool> center_at_startup;
value<int> center_method;
+ key_opts key_start_tracking, key_stop_tracking, key_toggle_tracking;
+ key_opts key_center, key_toggle, key_zero;
main_settings() :
opts("opentrack-ui"),
tracker_dll(b, "tracker-dll", ""),
@@ -58,6 +71,13 @@ struct main_settings : opts {
camera_pitch(b, "camera-pitch", 0),
camera_roll(b, "camera-roll", 0),
center_at_startup(b, "center-at-startup", true),
- center_method(b, "centering-method", true)
- {}
+ center_method(b, "centering-method", true),
+ key_start_tracking(b, "start-tracking"),
+ key_stop_tracking(b, "stop-tracking"),
+ key_toggle_tracking(b, "toggle-tracking"),
+ key_center(b, "center"),
+ key_toggle(b, "toggle"),
+ key_zero(b, "zero")
+ {
+ }
};