(This article is as well available in Russian).
I found a new way to bind input language (input source) switch to the Caps Lock button in Mac OS X. Unlike Kirgudu, the Russian application which is also able to do that, my method works without a lag, so language changes instantly after pressing the Caps Lock button. This is especially important if you’re a fast typer: with Kirgudu, when you start typing right after pressing the Caps Lock, the first letters of a new word might appear in a previously selected language. (I.e. if you used English and Russian layouts, instead of www.google.com, you’d type ццw.google.com).
The logic behind my method is: in OS X system settings, I bind input source selection to the F19 button (instead of default Cmd + Space — which you will still be able to use, by the way). Then, by the means of PCKeyboardHack (driver patch with a “System Preferences” pane, written by Takayama Fumihiko) Caps Lock is remapped to F19. And of course, it will work regardless of your keyboard having a F19 key.
It should work on Mac OS X Leopard and Snow Leopard — but I don’t know about Tiger.
Cons
- You will not be able to toggle the Caps Lock mode anymore.
- The green light on the button of your keyboard will not change as you change the input source — it will be lid constantly.
- You will have to uninstall DoubleCommand and any other keyboard remappers.
- This way is harder than simply installing Kirgudu.
If you don’t like it later or something won’t work, you will always be able to revert changes. Every mentioned program has an uninstaller.
Step-by-step guide
- Download and install PCKeyboardHack (requires a reboot).
- In System Preferences go to “Keyboard” → click the “Modifier Keys…” button and for Caps Lock choose “No action”.

- If your keyboard does have a F19 key, you may skip this step. Otherwise download my application (actually, this is just a line of AppleScript wrapped into an application), which will press this button virtually. After downloading, unpack and mount the .dmg and drag “Simulate F19” to the Dock (temporarily).

- Switch to “Keyboard Shortcuts” tab in the same window, select “Keyboard & Text Input” and find “Select the previous input source” (or “next source” — does not matter). Double click the shortcut to change it. Now, if you have F19 on your keyboard, just press it, otherwise press Simulate F19.app in the Dock (if your window lost focus, try once or twice again until the result: double click the shortcut field and press Simulate F19.app). Here is what you should get eventually:
If it worked out, you can remove Simulate F19 from the Dock. - Return to the main window of System Preferences and choose PCKeyboardHack. Tick “Change Caps Lock” and in the “keycode” column change 51 to 80.

Done!
Additional information
If there is a noticeable delay, download and install KeyRemap4MacBook (requires a reboot). Choose it in System Preferences, select “Mapping” tab, in search field type “capslock” and tick “Enable CapsLock LED Hack” thereafter. This is required to suppress accidental activation protection, used for the Caps Lock button in Mac OS X.
For advanced users: instead of F19 you may use any other key in the range of F13–F19. To do that, in the third step choose an appropriate application (Simulate F13, Simulate F14 etc). And in the fifth step, instead of 80, you need to pick a keycode according to the following table:
| Button | Keycode |
|---|---|
| F13 | 105 |
| F14 | 107 |
| F15 | 113 |
| F16 | 106 |
| F17 | 64 |
| F18 | 79 |
| F19 | 80 |
Thank you for useful information.
Changing language by the one-shot push of the Command key is also convenient, try it if interested.
http://pqrs.org/macosx/keyremap4macbook/files/KeyRemap4MacBook-6.5.55.pkg.zip
For Russian > Change Command_L Key > Command_L to Command_L (+ When you type Command_L only, change inputmode to english)
For Russian > Change Command_R Key > Command_R to Command_R (+ When you type Command_R only, change inputmode to russian)
Great guide, thanks!
Thanks so much! This is a fantastic tool for my new Mac!
Hey thanks to you for the last new entry.