Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing caps lock input on macOS #1601

Merged
merged 2 commits into from
Jul 7, 2024

Conversation

colincornaby
Copy link
Contributor

This is for fixing #1599.

I don't see any facilities in Cocoa to query the current state of caps lock, only updates. It seems like that might be present in HID - but HID is gated by security permissions in recent macOS releases. So far I've considered HID out of bounds for macOS.

@dpogue - If you have any Cocoa APIs I don't know about I'd be happy to implement. Would also be happy to forward on to Apple for guidance. I didn't see anything during my research online - and it does not even seem like the Game Controller framework supports querying Caps Lock. But my investigation was pretty shallow.

Querying for the current state of caps lock after coming back to foreground is not implemented
@colincornaby colincornaby requested a review from dpogue July 7, 2024 03:18
Copy link
Member

@dpogue dpogue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks alright to me

@@ -171,8 +177,11 @@ - (BOOL)processKeyEvent:(NSEvent*)event
}

@synchronized(self.view.layer) {
self.inputManager->HandleKeyEvent(
(plKeyDef)keycode, down, event.type == NSEventTypeFlagsChanged ? false : event.ARepeat);
// Caps lock modifer has sepcial handling that was earlier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: sepcial -> special

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Attempting to correct caps lock state if it’s changed in the background
@colincornaby colincornaby merged commit 01d0704 into H-uru:master Jul 7, 2024
17 checks passed
@dpogue dpogue linked an issue Jul 9, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[macOS] Caps Lock does not turn on running
2 participants