From e93db035ba4511e53c8bb5b8fbcd108f962ee988 Mon Sep 17 00:00:00 2001 From: rarified Date: Wed, 9 Mar 2022 09:44:05 -0700 Subject: [PATCH] Revert "Fixes bug where avatar run-lock state can get confused after alt-tabbing" This reverts commit 69dac251b6742ab7f77bed1a676e8de52920bd90. --- .../Plasma/PubUtilLib/plInputCore/plInputDevice.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.cpp b/Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.cpp index af3f6132..eec78f77 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.cpp +++ b/Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.cpp @@ -176,16 +176,19 @@ void plKeyboardDevice::HandleKeyEvent(plOSMsg message, plKeyDef key, bool bKeyDo if (key == KEY_SHIFT) { fShiftKeyDown = bKeyDown; +// return; } if (key == KEY_CTRL) { fCtrlKeyDown = bKeyDown; +// return; } if (key == KEY_CAPSLOCK) { - if (!bKeyRepeat) + // Keyboards toggle the light on key-down, so I'm going with that. + if (bKeyDown && !bKeyRepeat) { - fCapsLockLock = (GetKeyState(KEY_CAPSLOCK) & 1) == 1; + fCapsLockLock = !fCapsLockLock; plAvatarInputInterface::GetInstance()->ForceAlwaysRun(fCapsLockLock); } } @@ -205,8 +208,7 @@ void plKeyboardDevice::HandleWindowActivate(bool bActive, HWND hWnd) { if (bActive) { - // Refresh the caps lock state - HandleKeyEvent(KEYDOWN, KEY_CAPSLOCK, nil, false); + fCtrlKeyDown = false; } else {