From feab36b4f3f5fba2fb478f7ef20ea61ee6666b6a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 21 May 2017 08:34:00 +0200 Subject: dinput: minor cleanup --- dinput/keybinding-worker.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'dinput') 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; } } -- cgit v1.2.3