Skip to content

Remove Caps Lock control and optimize monitoring - #1

Merged
TW527E merged 1 commit into
mainfrom
codex/remove-caps-lock-and-optimize
Jul 31, 2026
Merged

TW527E merged 1 commit into
mainfrom
codex/remove-caps-lock-and-optimize

Conversation

@TW527E

@TW527E TW527E commented Jul 31, 2026

Copy link
Copy Markdown
Owner

What changed

  • remove the Caps Lock system preference controller, Settings checkbox, and menu item
  • remove all Caps Lock documentation
  • reduce the event-tap mask based on the enabled Shift and Shift-Space features
  • rebuild the event tap safely when settings change or macOS disables it
  • use one consistent TIS snapshot for each input-source notification
  • refresh menu state when the menu opens

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
  • debug and release Swift builds passed
  • real ABC-to-Apple-Pinyin source/layout confirmation passed
  • dynamic event-monitor reconfiguration check passed
  • application lifecycle and menu-bar smoke test passed
  • local DMG verification passed

@TW527E
TW527E marked this pull request as ready for review July 31, 2026 14:42
Copilot AI review requested due to automatic review settings July 31, 2026 14:42
@TW527E
TW527E merged commit 9fdd6e5 into main Jul 31, 2026
3 checks passed
@TW527E
TW527E deleted the codex/remove-caps-lock-and-optimize branch July 31, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

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.

2 participants