feat(indicator): add option to always display the indicator near the mouse cursor - #132
Open
gum798 wants to merge 1 commit into
Open
feat(indicator): add option to always display the indicator near the mouse cursor#132gum798 wants to merge 1 commit into
gum798 wants to merge 1 commit into
Conversation
…mouse cursor Add an opt-in "Always Display Indicator Near the Mouse Cursor" setting under the "Follow Mouse" position mode. While it is on, the indicator stays visible and tracks the pointer in real time instead of appearing only on app or input source changes. It needs no Accessibility permission: pointer movement comes from global and local NSEvent monitors throttled to ~60 Hz, and the panel is re-ordered front on Space changes so it follows across Spaces. The mode owns the indicator through a dedicated pipeline that renders the current input source (and the function-key badge for a second), hides it for apps with a "hide indicator" rule, and re-renders when indicator style or per-keyboard colours change. The activate-event pipeline stays idle while the mode is on, and the text-caret options under Advanced are disabled since they do not apply. Extracts the near-mouse geometry into IndicatorPosition.pointNearMouse so the one-shot "Follow Mouse" placement and the new mode share it, and covers it with unit tests. Also guards NSEvent.watch against a nil monitor on teardown, wires the preference through settings backup/restore, and adds localization for en, ja, ko, zh-Hans and zh-Hant. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PYfrZ8oYRfkLjVXUBF5BHA
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.
Purpose
Add an opt-in way to keep the input source indicator always visible and glued to the mouse pointer, the way Windows' IME badge follows the cursor. Today the indicator either pops up briefly on app / input-source changes, or (with Enhanced Mode) stays near the text caret. Users who want to glance at the current input source at any time, without Accessibility permission, had no option.
Loosely related to #61, which asks about positioning the always-on dot, though that one is about the text caret.
What changes
NSEventmouse monitors, throttled to ~60 Hz); it appears immediately when the toggle is switched on and disappears immediately when switched off;IndicatorPosition.pointNearMouseextracts the near-mouse geometry (offset + screen clamping) that the existing one-shot Follow Mouse placement used, so both paths share it. Covered by new unit tests.NSEvent.watchno longer force-unwraps the monitor on teardown.Testing
xcodebuild -scheme "Input Source Pro" -configuration Debug test: 55 tests pass (4 new inIndicatorNearMousePointTests).Notes for review
🤖 Generated with Claude Code
https://claude.ai/code/session_01PYfrZ8oYRfkLjVXUBF5BHA