summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--opentrack/keybinding-worker.hpp10
-rw-r--r--opentrack/shortcuts.h5
-rw-r--r--opentrack/win32-joystick.cpp4
3 files changed, 14 insertions, 5 deletions
diff --git a/opentrack/keybinding-worker.hpp b/opentrack/keybinding-worker.hpp
index c4a39ec6..83ffadf1 100644
--- a/opentrack/keybinding-worker.hpp
+++ b/opentrack/keybinding-worker.hpp
@@ -59,19 +59,18 @@ struct Key { int foo; };
struct OPENTRACK_EXPORT KeybindingWorker : private QThread
{
private:
+#ifdef _WIN32
LPDIRECTINPUT8 din;
LPDIRECTINPUTDEVICE8 dinkeyboard;
-#ifdef _WIN32
win32_joy_ctx& joy_ctx;
-#endif
volatile bool should_quit;
using fun = std::function<void(Key&)>;
std::vector<fun> receivers;
QMutex mtx;
-
+
void run() override;
KeybindingWorker();
-
+
KeybindingWorker(const KeybindingWorker&) = delete;
KeybindingWorker& operator=(KeybindingWorker&) = delete;
static KeybindingWorker& make();
@@ -100,4 +99,7 @@ public:
{
return Token(receiver);
}
+#else
+ void run() override {}
+#endif
};
diff --git a/opentrack/shortcuts.h b/opentrack/shortcuts.h
index 930952e8..8acc5ba5 100644
--- a/opentrack/shortcuts.h
+++ b/opentrack/shortcuts.h
@@ -66,7 +66,10 @@ public:
{}
} s;
- Shortcuts() : key_token(KeybindingWorker::add_receiver([&](const Key& k) { receiver(k); }))
+ Shortcuts()
+#ifdef _WIN32
+ : key_token(KeybindingWorker::add_receiver([&](const Key& k) { receiver(k); }))
+#endif
{
reload();
}
diff --git a/opentrack/win32-joystick.cpp b/opentrack/win32-joystick.cpp
index b4a1f9cd..56a1b070 100644
--- a/opentrack/win32-joystick.cpp
+++ b/opentrack/win32-joystick.cpp
@@ -1,5 +1,7 @@
#include "win32-joystick.hpp"
+#ifdef _WIN32
+
LPDIRECTINPUT8& win32_joy_ctx::dinput_handle()
{
(void) CoInitialize(nullptr);
@@ -28,3 +30,5 @@ win32_joy_ctx& win32_joy_ctx::make()
static win32_joy_ctx ret;
return ret;
}
+
+#endif