Skip to content

Commit

Permalink
Fixing caps lock input on macOS
Browse files Browse the repository at this point in the history
Querying for the current state of caps lock after coming back to foreground is not implemented
  • Loading branch information
colincornaby committed Jul 7, 2024
1 parent f85fd87 commit 2f3dc89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ - (BOOL)processKeyEvent:(NSEvent*)event
if (keycode == kVK_Control) {
down = (event.modifierFlags & NSEventModifierFlagControl) != 0;
}
if (keycode == kVK_CapsLock) {
down = (event.modifierFlags & NSEventModifierFlagCapsLock) != 0;
}

/*
This gets weird.
Expand Down
2 changes: 2 additions & 0 deletions Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ void plKeyboardDevice::HandleKeyEvent(plKeyDef key, bool bKeyDown, bool bKeyRepe
{
#ifdef HS_BUILD_FOR_WIN32
fCapsLockLock = (GetKeyState(KEY_CAPSLOCK) & 1) == 1;
#else
fCapsLockLock = bKeyDown;
#endif
plAvatarInputInterface::GetInstance()->ForceAlwaysRun(fCapsLockLock);
}
Expand Down

0 comments on commit 2f3dc89

Please sign in to comment.