summaryrefslogtreecommitdiffhomepage
path: root/opentrack/keybinding-worker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'opentrack/keybinding-worker.cpp')
-rw-r--r--opentrack/keybinding-worker.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/opentrack/keybinding-worker.cpp b/opentrack/keybinding-worker.cpp
index 29b2cf9f..e6c023ef 100644
--- a/opentrack/keybinding-worker.cpp
+++ b/opentrack/keybinding-worker.cpp
@@ -72,6 +72,19 @@ void KeybindingWorker::run() {
while (!should_quit)
{
+ {
+ using joy_fn = std::function<void(const QString& guid, int idx)>;
+
+ joy_fn f = [&](const QString& guid, int idx) -> void {
+ Key k;
+ k.keycode = idx;
+ k.guid = guid;
+ receiver(k);
+ };
+
+ joy_ctx.poll(f);
+ }
+
if (dinkeyboard->GetDeviceState(256, (LPVOID)keystate) != DI_OK) {
qDebug() << "Tracker::run GetDeviceState function failed!" << GetLastError();
Sleep(25);