summaryrefslogtreecommitdiffhomepage
path: root/gui/options-dialog.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-04-29 09:21:10 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-04-29 09:21:23 +0200
commit3a7011ff73cce39ecacb4c5651c1a2dbda8eb10e (patch)
tree84d21d48998aaacbad9cb27b7e5edf29b0dd1396 /gui/options-dialog.cpp
parent69cc802722c8264c0fd8b138a298d4820c11f1d8 (diff)
api, main: implement new keybindings
The following keybindings are now implemented: - restart tracking. if not started, starts. - toggle (keep position) while key held - zero (keep zero) while key held The latter two options only work for Windows as libqxt doesn't support them. Closes #291
Diffstat (limited to 'gui/options-dialog.cpp')
-rwxr-xr-x[-rw-r--r--]gui/options-dialog.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp
index e1324ccc..c99bc730 100644..100755
--- a/gui/options-dialog.cpp
+++ b/gui/options-dialog.cpp
@@ -78,17 +78,24 @@ OptionsDialog::OptionsDialog(main_settings& main,
connect(ui.bind_center, &QPushButton::pressed, [&]() -> void { bind_key(main.key_center, ui.center_text); });
connect(ui.bind_zero, &QPushButton::pressed, [&]() -> void { bind_key(main.key_zero, ui.zero_text); });
connect(ui.bind_toggle, &QPushButton::pressed, [&]() -> void { bind_key(main.key_toggle, ui.toggle_text); });
+ connect(ui.bind_toggle_held, &QPushButton::pressed, [&]() -> void { bind_key(main.key_toggle_press, ui.toggle_held_text); });
+ connect(ui.bind_zero_held, &QPushButton::pressed, [&]() -> void { bind_key(main.key_zero_press, ui.zero_held_text); });
+
connect(ui.bind_start, &QPushButton::pressed, [&]() -> void { bind_key(main.key_start_tracking, ui.start_tracking_text); });
connect(ui.bind_stop, &QPushButton::pressed, [&]() -> void { bind_key(main.key_stop_tracking, ui.stop_tracking_text); });
connect(ui.bind_toggle_tracking, &QPushButton::pressed, [&]() -> void { bind_key(main.key_toggle_tracking, ui.toggle_tracking_text); });
+ connect(ui.bind_restart_tracking, &QPushButton::pressed, [&]() -> void { bind_key(main.key_restart_tracking, ui.restart_tracking_text); });
ui.center_text->setText(kopts_to_string(main.key_center));
ui.toggle_text->setText(kopts_to_string(main.key_toggle));
+ ui.toggle_held_text->setText(kopts_to_string(main.key_toggle_press));
ui.zero_text->setText(kopts_to_string(main.key_zero));
+ ui.zero_held_text->setText(kopts_to_string(main.key_zero_press));
ui.start_tracking_text->setText(kopts_to_string(main.key_start_tracking));
ui.stop_tracking_text->setText(kopts_to_string(main.key_stop_tracking));
ui.toggle_tracking_text->setText(kopts_to_string(main.key_toggle_tracking));
+ ui.restart_tracking_text->setText(kopts_to_string(main.key_restart_tracking));
}
void OptionsDialog::bind_key(key_opts& kopts, QLabel* label)