diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-11-22 17:46:46 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-11-22 17:46:46 +0100 |
commit | 0c3a306b8588ae1cbe190ee18db2336bcd0eb527 (patch) | |
tree | 95fb3d748d4e42130df561ddc512e72aa6e0c47e /opentrack/keybinding-worker.cpp | |
parent | aac65283a2b254f0338a6ad1609e5d916ba9dcfc (diff) |
api/shortcuts: hopefully guard joystick _WIN32
Diffstat (limited to 'opentrack/keybinding-worker.cpp')
-rw-r--r-- | opentrack/keybinding-worker.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/opentrack/keybinding-worker.cpp b/opentrack/keybinding-worker.cpp index 5f42f44e..3659a768 100644 --- a/opentrack/keybinding-worker.cpp +++ b/opentrack/keybinding-worker.cpp @@ -27,7 +27,11 @@ KeybindingWorker::~KeybindingWorker() { din->Release(); } -KeybindingWorker::KeybindingWorker() : joy_ctx(win32_joy_ctx::make()), should_quit(true) +KeybindingWorker::KeybindingWorker() : +#ifdef _WIN32 + joy_ctx(win32_joy_ctx::make()), +#endif + should_quit(true) { if (DirectInput8Create(GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&din, NULL) != DI_OK) { qDebug() << "setup DirectInput8 Creation failed!" << GetLastError(); @@ -94,6 +98,7 @@ void KeybindingWorker::run() { } } +#ifdef _WIN32 { using joy_fn = std::function<void(const QString& guid, int idx, bool held)>; @@ -112,6 +117,7 @@ void KeybindingWorker::run() { joy_ctx.poll(f); } +#endif for (int i = 0; i < 256; i++) { |