diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-05-21 08:34:00 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-05-21 08:34:00 +0200 |
commit | feab36b4f3f5fba2fb478f7ef20ea61ee6666b6a (patch) | |
tree | c41bad2933b7c2d03f7c8f0ea98405a6a05c2058 /dinput/keybinding-worker.cpp | |
parent | c5b0135fff823945642cd5fe3aff7bc8e92e215e (diff) |
dinput: minor cleanup
Diffstat (limited to 'dinput/keybinding-worker.cpp')
-rw-r--r-- | dinput/keybinding-worker.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/dinput/keybinding-worker.cpp b/dinput/keybinding-worker.cpp index 0e16ac71..71ab6d9c 100644 --- a/dinput/keybinding-worker.cpp +++ b/dinput/keybinding-worker.cpp @@ -134,7 +134,7 @@ void KeybindingWorker::run() Key k; if (old_keystate[i] != keystate[i]) { - const bool held = keystate[i] & 0x80; + const bool held = !!(keystate[i] & 0x80); switch (i) { case DIK_LCONTROL: @@ -145,14 +145,14 @@ void KeybindingWorker::run() case DIK_RALT: break; default: - k.shift = !!(keystate[DIK_LSHIFT] & 0x80) || !!(keystate[DIK_RSHIFT] & 0x80); - k.alt = !!(keystate[DIK_LALT] & 0x80) || !!(keystate[DIK_RALT] & 0x80); - k.ctrl = !!(keystate[DIK_LCONTROL] & 0x80) || !!(keystate[DIK_RCONTROL] & 0x80); + k.shift = !!((keystate[DIK_LSHIFT] & 0x80) || (keystate[DIK_RSHIFT] & 0x80)); + k.alt = !!((keystate[DIK_LALT] & 0x80) || (keystate[DIK_RALT] & 0x80)); + k.ctrl = !!((keystate[DIK_LCONTROL] & 0x80) || (keystate[DIK_RCONTROL] & 0x80)); k.keycode = i; k.held = held; for (auto& r : receivers) - r->operator()(k); + r(k); break; } } |