summaryrefslogtreecommitdiffhomepage
path: root/opentrack/keybinding-worker.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-12-06 05:15:07 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-12-06 05:15:07 +0100
commit1aa7bceaed59770adeb389d6c4c8f5561d0e7402 (patch)
treed4c056105771ca8959e843b74a8d80ab9457d6c2 /opentrack/keybinding-worker.cpp
parent4e74d6edef94e4f2f7caae76088f91e9ee993fba (diff)
api/keys: use a fake window for DirectInput handle
Diffstat (limited to 'opentrack/keybinding-worker.cpp')
-rw-r--r--opentrack/keybinding-worker.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/opentrack/keybinding-worker.cpp b/opentrack/keybinding-worker.cpp
index 461f8416..2ac814af 100644
--- a/opentrack/keybinding-worker.cpp
+++ b/opentrack/keybinding-worker.cpp
@@ -35,9 +35,6 @@ KeybindingWorker::~KeybindingWorker() {
}
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) {
@@ -58,7 +55,8 @@ KeybindingWorker::KeybindingWorker() :
din = 0;
return;
}
- if (dinkeyboard->SetCooperativeLevel(GetDesktopWindow(), DISCL_NONEXCLUSIVE | DISCL_BACKGROUND) != DI_OK) {
+
+ if (dinkeyboard->SetCooperativeLevel((HWND) fake_main_window.winId(), DISCL_NONEXCLUSIVE | DISCL_BACKGROUND) != DI_OK) {
dinkeyboard->Release();
din->Release();
din = 0;