Toggle the keyboard language by *holding* a button?
You can use KeyRemap4MacBook:

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


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.