Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

On my Linux computer, my keyboard switches from English to Serbian when I hold the Caps Lock key. For example, to write č all I have to do is hold Caps Lock, and press the key where č is on the Serbian keyboard (in this case, they key is ; on the English keyboard). When I release Caps Lock, the keyboard "switches back" to English, so that if I press ; I get ; as desired. Super useful.

Is there a way to replicate this behavior on OS X?

share|improve this question

4 Answers 4

up vote 2 down vote accepted

You can use KeyRemap4MacBook:

<?xml version="1.0"?>
<root>
  <vkchangeinputsourcedef>
    <name>KeyCode::VK_CHANGE_INPUTSOURCE_SERBIAN</name>
    <inputsourceid_equal>com.apple.keylayout.Serbian</inputsourceid_equal>
  </vkchangeinputsourcedef>
  <item>
    <name>test</name>
    <identifier>test</identifier>
    <autogen>__KeyToKey__ KeyCode::F1, KeyCode::VK_NONE, Option::KEYTOKEY_BEFORE_KEYDOWN, KeyCode::VK_CHANGE_INPUTMODE_SERBIAN, Option::KEYTOKEY_AFTER_KEYUP, KeyCode::VK_CHANGE_INPUTMODE_ENGLISH</autogen>
  </item>
</root>

VK_CHANGE_INPUTMODE_ENGLISH is defined in inputsourcedef.xml. You can see the IDs of input sources from EventViewer.app. Caps lock can be remapped to an F-key with PCKeyboardHack.

share|improve this answer
    
Actually, this seems close to what I want (although it's a tad too involved to be practical). –  Syzygy Aug 9 '12 at 2:57
    
The KeyRemap4MacBook is the way to do it, I think. A similar solution with AutoHotKey works on Win 8 for me. –  Syzygy Oct 25 '12 at 16:02

If you're on 10.7 Lion or newer, you can also press the c key down until it shows a list of all c characters with various decorations.

share|improve this answer
    
This is awesome! I wish I could +10! Thank you for improving my life. –  Sam Lisi May 22 '13 at 16:17

You can easily switch from the Serbian keyboard to the US keyboard or vice versa by pressing Command-Space. To set this up:

Go to System Preferences..., Language & Text, Input Sources, and select both the Serbian and English keyboard layouts. Select the check box next to Show Input menu in menu bar. Make sure that under Input source shortcuts that Select previous input source: is set to Command-Space.

This is all you need to do.

enter image description here

share|improve this answer
    
This actually isn't what I am asking for. I know you can toggle to, and from, a keyboard layout. What I want is to hold Caps Lock as a modifier key. For example, Shift modifies the letter pressed to upper case. I want Caps Lock to modify the keyboard to be Serbian, for the duration of the press. –  Syzygy Aug 9 '12 at 2:58
    
You can define a different modifier key other than Command-Space, by clicking on the Keyboard Shortcuts button in the dialog shown above. –  Wheat Williams Aug 9 '12 at 17:51

The Alt key gives you access to a number of non ascii characters that depend on the layout you use.

On a standard US keyboard, pressing Alt+underbar creates a " ` " under which the vowel you'll type after will come: " à " if I type Alt+underbar followed by a.

In your case, the US Extended layout will give you access to all the accents that you need to use in Serbian. For ex, Alt+v followed by c will give you č.

You need to keep the Keyboard Viewer opened to get used to the various possible modifications but once you get the set that is used in your language you won't need it anymore.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.