summaryrefslogtreecommitdiffhomepage
path: root/opentrack/keybinding-worker.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-11 13:44:45 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-11 13:44:45 +0100
commit17849b12f232c89bdae16f7e179d3a92a32280ad (patch)
tree5da1a08fd694971afe7a707069a38d1a1be2f92d /opentrack/keybinding-worker.cpp
parentc4c3e746f030e6c5e5a1f8b88762fae95d1b9225 (diff)
shortcuts: map joystick buttons on depress only
Some buttons like the X65 mode switch are held all the time. Prevent them from hogging all the keybindings. Issue: #118
Diffstat (limited to 'opentrack/keybinding-worker.cpp')
-rw-r--r--opentrack/keybinding-worker.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/opentrack/keybinding-worker.cpp b/opentrack/keybinding-worker.cpp
index e6c023ef..e9255801 100644
--- a/opentrack/keybinding-worker.cpp
+++ b/opentrack/keybinding-worker.cpp
@@ -73,12 +73,13 @@ void KeybindingWorker::run() {
while (!should_quit)
{
{
- using joy_fn = std::function<void(const QString& guid, int idx)>;
+ using joy_fn = std::function<void(const QString& guid, int idx, bool held)>;
- joy_fn f = [&](const QString& guid, int idx) -> void {
+ joy_fn f = [&](const QString& guid, int idx, bool held) -> void {
Key k;
k.keycode = idx;
k.guid = guid;
+ k.held = held;
receiver(k);
};