Input Source Lock
A tiny macOS menu bar app that keeps your chosen input source selected.
Input Source Lock is for people who use one input method most of the day and do not want macOS, apps, documents, or keyboard shortcuts to quietly switch them back to another source.
It is event-driven, not polling. The app listens for macOS input-source change notifications and only wakes when the system reports a change. If the active input source is not the one you locked, it immediately switches back.
What It Does
- Lists your enabled keyboard layouts and input methods in the menu bar.
- Lets you choose one input source to lock.
- Automatically switches back when macOS changes to another input source.
- Stores your choice in
UserDefaults. - Can register itself as a login item from the menu.
- Can hide its menu bar icon while the lock keeps running.
- Runs without a Dock icon.
Why
macOS has a few helpful features that can be unhelpful in daily use:
- switching input sources per document;
- restoring an app or text field to a previous input source;
- accidental
Control + Spaceinput-source switching; - third-party input methods getting replaced by ABC or the built-in Pinyin.
This app keeps the final choice yours.
Requirements
- macOS 13 Ventura or later
- Xcode Command Line Tools
- Swift 6 compatible toolchain
Build
git clone git@github.com:Anionex/input-source-lock.git
cd input-source-lock
./Scripts/build-app.sh
The app bundle will be created at:
dist/Input Source Lock.app
Install
./Scripts/install-app.sh
This builds the app, copies it to /Applications, and opens it.
Use
- Open Input Source Lock.
- Click the keyboard icon in the macOS menu bar.
- Choose Choose Input Source.
- Select the input source you want to keep fixed.
- Keep Lock Selected Input Source checked.
- Optional: choose Enable Launch at Login.
- Optional: choose Hide Menu Bar Icon if you want it to keep working without taking menu bar space.
The app will switch back whenever macOS changes away from your selected input source.
Show or Hide the Menu Bar Icon
Input Source Lock does not need its menu bar icon to keep the lock active.
- Choose Hide Menu Bar Icon to remove the icon while the app keeps running.
- Open Input Source Lock again from Finder, Spotlight, Launchpad, or
/Applicationsto show the menu bar icon again. - Choose Quit if you want to stop the app completely.
Notes
Some secure macOS fields, the login screen, remote desktop sessions, and password prompts may still force system-controlled behavior. Input Source Lock does not bypass macOS security boundaries; it simply reacts to normal input source changes in your user session.
For best results, also consider disabling macOS's own automatic switching:
- Open System Settings.
- Go to Keyboard.
- Open Text Input or Input Sources.
- Disable Automatically switch to a document's input source if present.
Uninstall
./Scripts/uninstall.sh
If you enabled launch at login, disable it from the menu before uninstalling.
Development
Run from source:
swift run -c debug InputSourceLock
Build a signed local app bundle:
./Scripts/build-app.sh
The local bundle is ad-hoc signed with:
codesign --force --deep --sign -
License
MIT