diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-11-01 13:40:12 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-11-01 13:40:12 +0100 |
commit | 2de33bda4758281b8c25d2786fd68769453bee3d (patch) | |
tree | 1aa38513e62d081e7c3733aad9fe1487f22d7a73 /dinput/keybinding-worker.cpp | |
parent | 1b78a8ffeb9c320747422ba10bf7c26018cae580 (diff) |
dinput: skip double negation for `bool' values
Diffstat (limited to 'dinput/keybinding-worker.cpp')
-rw-r--r-- | dinput/keybinding-worker.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/dinput/keybinding-worker.cpp b/dinput/keybinding-worker.cpp index fec28a03..3850d80b 100644 --- a/dinput/keybinding-worker.cpp +++ b/dinput/keybinding-worker.cpp @@ -158,9 +158,9 @@ void KeybindingWorker::run() default: { Key k; - k.shift = !!(keystate[DIK_LSHIFT] | keystate[DIK_RSHIFT]); - k.alt = !!(keystate[DIK_LALT] | keystate[DIK_RALT]); - k.ctrl = !!(keystate[DIK_LCONTROL] | keystate[DIK_RCONTROL]); + k.shift = keystate[DIK_LSHIFT] | keystate[DIK_RSHIFT]; + k.alt = keystate[DIK_LALT] | keystate[DIK_RALT]; + k.ctrl = keystate[DIK_LCONTROL] | keystate[DIK_RCONTROL]; k.keycode = idx; k.held = held; @@ -180,9 +180,9 @@ void KeybindingWorker::run() joy_fn f = [&](const QString& guid, int idx, bool held) { Key k; k.keycode = idx; - k.shift = !!(keystate[DIK_LSHIFT] | keystate[DIK_RSHIFT]); - k.alt = !!(keystate[DIK_LALT] | keystate[DIK_RALT]); - k.ctrl = !!(keystate[DIK_LCONTROL] | keystate[DIK_RCONTROL]); + k.shift = keystate[DIK_LSHIFT] | keystate[DIK_RSHIFT]; + k.alt = keystate[DIK_LALT] | keystate[DIK_RALT]; + k.ctrl = keystate[DIK_LCONTROL] | keystate[DIK_RCONTROL]; k.guid = guid; k.held = held; |