Repository navigation
Remove Caps Lock control and optimize monitoring - #1
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the unreliable macOS Caps Lock language-switch integration and streamlines global input monitoring to be more stable and lower-overhead, while keeping the remaining Shift and Shift+Space features consistent across UI and notifications.
Changes:
- Remove the Caps Lock controller + all related UI (menu + Settings) and documentation.
- Reconfigure the global event tap to monitor only the event types required by currently enabled shortcuts, and rebuild safely when configuration changes or the tap is disabled.
- Use a single TIS “current input source” snapshot per notification to keep persistence, capability detection, and UI updates consistent; refresh menu state on open.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/ShiftInput/StatusBarController.swift | Removes Caps Lock menu toggle and refreshes the “current source” menu item when the menu opens. |
| Sources/ShiftInput/PreferencesWindowController.swift | Removes the Caps Lock preference checkbox and related explanatory text; tightens window layout. |
| Sources/ShiftInput/InputSourceManager.swift | Uses one TIS snapshot per input-source notification to update persistence, capability detection, and UI consistently. |
| Sources/ShiftInput/GlobalKeyboardMonitor.swift | Introduces a configuration-driven event mask and rebuild logic to reduce monitored events and handle tap disablement. |
| Sources/ShiftInput/CapsLockLanguageSwitchController.swift | Deletes the Caps Lock system preference controller implementation. |
| Sources/ShiftInput/AppDelegate.swift | Removes Caps Lock wiring and rebuilds the keyboard monitor based on settings; rebuilds on tap disablement on main queue. |
| README.zh-CN.md | Removes Caps Lock docs; documents adaptive event mask and single-snapshot update behavior. |
| README.md | Removes Caps Lock docs; documents adaptive event mask and single-snapshot update behavior. |
| README.en.md | Removes Caps Lock docs; documents adaptive event mask and single-snapshot update behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Why
The macOS Caps Lock preference could report disabled while the system still performed language switching, so the feature was not reliable enough to keep. The remaining changes improve stability, consistency, and idle event-processing overhead without adding polling.
Validation
make test— 20 checks passed