Repository navigation
feat: list keyboard input sources and select one by ID - #90
Merged
Merged
Conversation
iamnbutler
force-pushed
the
feat/input-source
branch
from
October 17, 2026 07:25
59f7b95 to
6f536b7
Compare
iamnbutler
force-pushed
the
feat/input-source
branch
from
October 17, 2026 07:35
6f536b7 to
1b8c602
Compare
This was referenced Oct 17, 2026
Merged
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.
New tool
desktop_input_source, item 2 of the #75 top 3 (awkward 10).select, it lists the enabled, select-capable keyboard input sources fromTISCreateInputSourceList.id,name,kind(keyboard_layout,input_modeorinput_method), its first 8languages, andselected.currentandkeyboard_layout, the layoutdesktop_keymaps through.select: <id>, it selects the source withTISSelectInputSourceand pollsTISCopyCurrentKeyboardInputSourcefor up to 1 s.completed: the source reads back as selected, withbefore,currentandchanged.completedwithchanged: false, and nothing is called.unknown: no readback within the second.desktop_appssystem.input. It's spawned by the MCP server in the user's GUI session, and TIS state is per session, so no Bridge op or patch is needed. All TIS calls run on the main actor (TSM asserts the main queue on recent macOS), where the async main's run loop delivers TIS changes for the readback. If the client isn't in a GUI session (CGSessionCopyCurrentDictionaryis nil), selection is refused.input-source, shaped likedock: listing is a read, selecting is an action.Tests:
test/inputsource.test.mjscovers validation and the tool schema.npm testpasses 36 of 36, andnpm run checkpasses.Live, with the screen locked:
current: com.apple.keylayout.Canadian, with one source and its languages capped at 8.com.apple.keylayout.USwas refused: "The macOS GUI session is locked. The input source was not changed."