summaryrefslogtreecommitdiffhomepage
path: root/opentrack/keybinding-worker.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-11 06:14:00 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-11 06:14:00 +0100
commit2d90e4039c6dd1aab00c738f9bbc70a4949cd583 (patch)
tree9150b0f8732c51f767a705272bede9345c274901 /opentrack/keybinding-worker.hpp
parent2521a7918783758928a58f6032ca6fad53a89c01 (diff)
allow for binding joystick buttons to shortcut functions
Win32 only Issue: #118
Diffstat (limited to 'opentrack/keybinding-worker.hpp')
-rw-r--r--opentrack/keybinding-worker.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/opentrack/keybinding-worker.hpp b/opentrack/keybinding-worker.hpp
index e720ffdc..8cf59d65 100644
--- a/opentrack/keybinding-worker.hpp
+++ b/opentrack/keybinding-worker.hpp
@@ -15,6 +15,7 @@
#endif
#include "opentrack-compat/timer.hpp"
+#include "opentrack/win32-joystick-shortcuts.hpp"
#include <QThread>
#include <QMutex>
#include <QWidget>
@@ -27,6 +28,7 @@
# include <dinput.h>
struct Key {
BYTE keycode;
+ QString guid;
bool shift;
bool ctrl;
bool alt;
@@ -38,7 +40,7 @@ public:
bool should_process()
{
- if (keycode == 0)
+ if (keycode == 0 && guid == "")
return false;
bool ret = timer.elapsed_ms() > 100;
timer.start();
@@ -56,6 +58,7 @@ private:
LPDIRECTINPUT8 din;
LPDIRECTINPUTDEVICE8 dinkeyboard;
QMutex mtx;
+ win32_joy_ctx joy_ctx;
public:
volatile bool should_quit;
std::function<void(Key&)> receiver;