How to change the input source to different language with shortcut (only one key combination)? I want to use four language in my OS X system (English, Spanish, Chinese, and Japanese), and I know I can change the language with ⌘ + Space. However, I have a pathological hatred for switching with it, because it requires me to select from so, so many choices! I also know I can change it from the menubar on the right of the bar, but it's much more disgusting than the ⌘ + Space solution.

So I rather want to change it with easier shortcut, like the following:


left ⌘ switches to English
right ⌘ switches to Spanish
left ⌘ + left ⌥ + C switches to Chinese
right ⌘ + right ⌥ + C switches to Japanese.


I tried to use Karabiner (the descendent from KeyRemap4MacBook), but it doesn't work on the first attempt on Chinese, on which when I switches to Chinese, it remains English (the input source icon on the menubar changes, but the keyboard does not work). But for some reasons if I switch from English to Chinese to English to Chinese (two attempts), then the Chinese keyboard finally works.

So I don't like the idea of using Karabiner. So what is the better way to change the input source?
I ran into the same issue with Chinese and Japanese. (The icon on the menu bar changed but the input source was not actually changed until I switched to another input source and back.) It's a known bug according to a post at Karabiner's mailing list:


  It's one of the most annoying bug of OS X.
  
  Changing CJK input sources directly from program is not handled appropriately.
  
  So, you need the following procedures.
  
  Step1:
  Enable "Select next source in Input menu" (command-option-space) on System Preferences > Keyboard > Shortcuts.
  
  Step2:
  Change input source by sending command-option-space.

&lt;autogen&gt;
  __KeyToKey__
  KeyCode::K, ModifierFlag::OPTION_L,
  KeyCode::VK_CHANGE_INPUTMODE_US,
  KeyCode::VK_WAIT_100MS,
  KeyCode::SPACE, ModifierFlag::COMMAND_R | ModifierFlag::OPTION_L,
  &lt;!-- adjust wait for your machine --&gt;
  KeyCode::VK_WAIT_10MS,
  KeyCode::VK_WAIT_10MS,
  KeyCode::VK_WAIT_10MS,
  KeyCode::SPACE, ModifierFlag::COMMAND_R | ModifierFlag::OPTION_L,
  &lt;!-- adjust wait for your machine --&gt;
  KeyCode::VK_WAIT_10MS,
  KeyCode::VK_WAIT_10MS,
  KeyCode::VK_WAIT_10MS,
  KeyCode::SPACE, ModifierFlag::COMMAND_R | ModifierFlag::OPTION_L,

  Option::NOREPEAT,
&lt;/autogen&gt;



changeinput is affected by the same bug.

Another workaround is to just change to another input source and back:

&lt;root&gt;
  &lt;vkchangeinputsourcedef&gt;
    &lt;name&gt;KeyCode::VK_CHANGE_INPUTSOURCE_HIRAGANA&lt;/name&gt;
    &lt;inputsourceid_equal&gt;com.apple.inputmethod.Kotoeri.Japanese&lt;/inputsourceid_equal&gt;
  &lt;/vkchangeinputsourcedef&gt;
  &lt;vkchangeinputsourcedef&gt;
    &lt;name&gt;KeyCode::VK_CHANGE_INPUTSOURCE_SPANISH&lt;/name&gt;
    &lt;inputsourceid_equal&gt;com.apple.keylayout.Spanish&lt;/inputsourceid_equal&gt;
  &lt;/vkchangeinputsourcedef&gt;
  &lt;vkchangeinputsourcedef&gt;
    &lt;name&gt;KeyCode::VK_CHANGE_INPUTSOURCE_US&lt;/name&gt;
    &lt;inputsourceid_equal&gt;com.apple.keylayout.US&lt;/inputsourceid_equal&gt;
  &lt;/vkchangeinputsourcedef&gt;
  &lt;vkchangeinputsourcedef&gt;
    &lt;name&gt;KeyCode::VK_CHANGE_INPUTSOURCE_CHINESE&lt;/name&gt;
    &lt;inputsourceid_equal&gt;com.apple.inputmethod.TCIM.Pinyin&lt;/inputsourceid_equal&gt;
  &lt;/vkchangeinputsourcedef&gt;
  &lt;item&gt;
    &lt;name&gt;inputsources&lt;/name&gt;
    &lt;identifier&gt;inputsources&lt;/identifier&gt;
    &lt;autogen&gt;__KeyOverlaidModifier__ KeyCode::COMMAND_L, ModifierFlag::COMMAND_L | ModifierFlag::NONE, KeyCode::VK_CHANGE_INPUTSOURCE_US, KeyCode::COMMAND_L&lt;/autogen&gt;
    &lt;autogen&gt;__KeyOverlaidModifier__ KeyCode::COMMAND_R, ModifierFlag::COMMAND_R | ModifierFlag::NONE, KeyCode::VK_CHANGE_INPUTSOURCE_SPANISH, KeyCode::COMMAND_R&lt;/autogen&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::C, ModifierFlag::OPTION_L | ModifierFlag::COMMAND_L | ModifierFlag::NONE, KeyCode::VK_CHANGE_INPUTSOURCE_CHINESE, KeyCode::VK_CHANGE_INPUTSOURCE_US, KeyCode::VK_CHANGE_INPUTSOURCE_CHINESE&lt;/autogen&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::C, ModifierFlag::OPTION_R | ModifierFlag::COMMAND_R | ModifierFlag::NONE, KeyCode::VK_CHANGE_INPUTSOURCE_HIRAGANA, KeyCode::VK_CHANGE_INPUTSOURCE_US, KeyCode::VK_CHANGE_INPUTSOURCE_HIRAGANA&lt;/autogen&gt;
  &lt;/item&gt;
&lt;/root&gt;