Assign a key combination for each input language
First enable all necessary layouts in System Preferences -> Keyboard -> Input Sources


Download, install and open Karabiner
Open in the menulet Karabiner -> Preferences
Open the tab Misc &amp; Uninstall
Hit the button Open private.xml
Open the file private.xml with an appropriate editor
Enter customized input source definitions and keycodes

Example:

&lt;?xml version="1.0"?&gt;
&lt;root&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;item&gt;
    &lt;name&gt;Change input source to US by right shift key + U&lt;/name&gt;
    &lt;identifier&gt;private.change_input_source_to_us&lt;/identifier&gt;
    &lt;autogen&gt;
      __KeyToKey__
      KeyCode::U, ModifierFlag::SHIFT_R,
      KeyCode::VK_CHANGE_INPUTSOURCE_US
    &lt;/autogen&gt;
  &lt;/item&gt;

  &lt;vkchangeinputsourcedef&gt;
    &lt;name&gt;KeyCode::VK_CHANGE_INPUTSOURCE_GERMAN&lt;/name&gt;
    &lt;languagecode&gt;de&lt;/languagecode&gt;
  &lt;/vkchangeinputsourcedef&gt;

  &lt;item&gt;
    &lt;name&gt;Change input source to German by right shift key + D&lt;/name&gt;
    &lt;identifier&gt;private.change_input_source_to_german&lt;/identifier&gt;
    &lt;autogen&gt;
      __KeyToKey__
      KeyCode::D, ModifierFlag::SHIFT_R,
      KeyCode::VK_CHANGE_INPUTSOURCE_GERMAN
    &lt;/autogen&gt;
  &lt;/item&gt;

  &lt;vkchangeinputsourcedef&gt;
    &lt;name&gt;KeyCode::VK_CHANGE_INPUTSOURCE_UNICODEHEXINPUT&lt;/name&gt;
    &lt;inputsourceid_equal&gt;com.apple.keylayout.UnicodeHexInput&lt;/inputsourceid_equal&gt;
  &lt;/vkchangeinputsourcedef&gt;

    &lt;item&gt;
    &lt;name&gt;Change input source to HEX by right shift key + H&lt;/name&gt;
    &lt;identifier&gt;private.change_input_source_to_hex&lt;/identifier&gt;
    &lt;autogen&gt;
      __KeyToKey__
      KeyCode::H, ModifierFlag::SHIFT_R,
      KeyCode::VK_CHANGE_INPUTSOURCE_UNICODEHEXINPUT
    &lt;/autogen&gt;
    &lt;/item&gt;

&lt;/root&gt;


In the example hitting right shiftu will enable the US layout, right shiftg the german layout and right shifth the hex layout.

A comprehensive list of vkchangeinputsourcedefs is available here.
Save the file
Open in the menulet Karabiner -> Preferences the tab Change Key
Hit the ReloadXML button
Enable all "shortcuts". They are listed at the beginning.