Instantly switch between two keyboard layouts on macOS using the Caps Lock key.
Swift
45
3 commits
updated Apr 2, 2025
CapsLockSwitcher is a lightweight macOS background agent that provides instant, reliable switching between exactly two user-selected keyboard input sources (layouts) using the Caps Lock key.
It's designed to overcome the common frustrations with the native macOS input switching behavior.
Are you tired of:
CapsLockSwitcher solves these problems by providing a dedicated, fast, and targeted switching mechanism.
CGEventTap, Text Input Source Services) – no kernel extensions needed..app file.CapsLockSwitcher.app to your /Applications folder.CapsLockSwitcher from your Applications folder.xattr -cr /Applications/CapsLockSwitcher.app in the terminalxattr -cr /Applications/CapsLockSwitcher.app removes extended attributes recursively (-r) and clears code signing attributes (-c) from the CapsLockSwitcher.app application. It's essentially stripping away the "downloaded from the internet" flags that macOS Gatekeeper uses to restrict the app's execution.
CapsLockSwitcher in your Applications folder. A new icon (⚠️ or ⌨️...) will appear in your menu bar.CapsLockSwitcher in the list and enable the toggle next to it. If it's not listed, drag CapsLockSwitcher.app from your Applications folder into the list or use the '+' button.keyboard.fill), and the status text will show "Switcher: Active".CapsLockSwitcher needs Accessibility permissions for one specific reason:
CGEventTap to listen for keyboard events system-wide, specifically looking for the Caps Lock key press (keyDown and flagsChanged events). This is the standard macOS mechanism for this kind of functionality.The app does not log your keystrokes or send any data anywhere. It only checks if the key pressed is Caps Lock and, if configured, consumes that event to trigger the layout switch. Granting Accessibility permission is necessary for any application that needs to modify or observe input events outside of its own window.
git clone https://github.com/doasync/CapsLockSwitcher.gitCapsLockSwitcher.xcodeproj in Xcode (ensure you have a recent version compatible with Swift and macOS 13+ features like SMAppService).CapsLockSwitcher target and your Mac as the run destination..app bundle will be in the Products directory.Contributions are welcome! Please feel free to submit pull requests or open issues for bugs, feature requests, or suggestions.
This project is licensed under the MIT License - see the LICENSE.md file for details.
3 commits
Swift
100.0%
Instantly switch between two keyboard layouts on macOS using the Caps Lock key.
Swift
45
3 commits
updated Apr 2, 2025
CapsLockSwitcher is a lightweight macOS background agent that provides instant, reliable switching between exactly two user-selected keyboard input sources (layouts) using the Caps Lock key.
It's designed to overcome the common frustrations with the native macOS input switching behavior.
Are you tired of:
CapsLockSwitcher solves these problems by providing a dedicated, fast, and targeted switching mechanism.
CGEventTap, Text Input Source Services) – no kernel extensions needed..app file.CapsLockSwitcher.app to your /Applications folder.CapsLockSwitcher from your Applications folder.xattr -cr /Applications/CapsLockSwitcher.app in the terminalxattr -cr /Applications/CapsLockSwitcher.app removes extended attributes recursively (-r) and clears code signing attributes (-c) from the CapsLockSwitcher.app application. It's essentially stripping away the "downloaded from the internet" flags that macOS Gatekeeper uses to restrict the app's execution.
CapsLockSwitcher in your Applications folder. A new icon (⚠️ or ⌨️...) will appear in your menu bar.CapsLockSwitcher in the list and enable the toggle next to it. If it's not listed, drag CapsLockSwitcher.app from your Applications folder into the list or use the '+' button.keyboard.fill), and the status text will show "Switcher: Active".CapsLockSwitcher needs Accessibility permissions for one specific reason:
CGEventTap to listen for keyboard events system-wide, specifically looking for the Caps Lock key press (keyDown and flagsChanged events). This is the standard macOS mechanism for this kind of functionality.The app does not log your keystrokes or send any data anywhere. It only checks if the key pressed is Caps Lock and, if configured, consumes that event to trigger the layout switch. Granting Accessibility permission is necessary for any application that needs to modify or observe input events outside of its own window.
git clone https://github.com/doasync/CapsLockSwitcher.gitCapsLockSwitcher.xcodeproj in Xcode (ensure you have a recent version compatible with Swift and macOS 13+ features like SMAppService).CapsLockSwitcher target and your Mac as the run destination..app bundle will be in the Products directory.Contributions are welcome! Please feel free to submit pull requests or open issues for bugs, feature requests, or suggestions.
This project is licensed under the MIT License - see the LICENSE.md file for details.
3 commits
Swift
100.0%