summaryrefslogtreecommitdiffhomepage
path: root/logic/work.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-03-10 18:09:07 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-03-10 18:35:13 +0100
commit96ac77abb5c4f8cd22135034c8a1270cf946ceca (patch)
treed27b71df408b924c1e93e1b5c7066c1a5674fbbc /logic/work.cpp
parentae1913228833d10b66636f2ff4d2b7ecc70ef142 (diff)
logic/pipeline: implement held center
Requested by: CAHEK on the Russian IL-2 Sturmovik forum
Diffstat (limited to 'logic/work.cpp')
-rw-r--r--logic/work.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/logic/work.cpp b/logic/work.cpp
index 11ec9912..99e4f709 100644
--- a/logic/work.cpp
+++ b/logic/work.cpp
@@ -65,8 +65,13 @@ Work::Work(Mappings& m, event_handler& ev, QFrame* frame, std::shared_ptr<dylib
tracker(std::make_shared<pipeline>(m, libs, ev, *logger)),
sc(std::make_shared<Shortcuts>()),
keys {
+#if defined OTR_HAS_KEY_UP_SUPPORT
+ key_tuple(s.key_center1, [&](bool x) { tracker->set_held_center(x); }, false),
+ key_tuple(s.key_center2, [&](bool x) { tracker->set_held_center(x); }, false),
+#else
key_tuple(s.key_center1, [&](bool) { tracker->set_center(); }, true),
key_tuple(s.key_center2, [&](bool) { tracker->set_center(); }, true),
+#endif
key_tuple(s.key_toggle1, [&](bool) { tracker->toggle_enabled(); }, true),
key_tuple(s.key_toggle2, [&](bool) { tracker->toggle_enabled(); }, true),