Skip to content

Instantly share code, notes, and snippets.

@ylorn
Last active August 29, 2015 14:21
Show Gist options
  • Save ylorn/43b589daf6d621a7fc47 to your computer and use it in GitHub Desktop.
Save ylorn/43b589daf6d621a7fc47 to your computer and use it in GitHub Desktop.
single tap right shift to simulate command + space to select previous input method, however holding right shift still remain the modifier key.
<?xml version="1.0"?>
<root>
<inputsourcedef>
<name>MY_CHINESE</name>
<inputsourceid_prefix>
com.apple.inputmethod.SCIM.ITABC
</inputsourceid_prefix>
</inputsourcedef>
<inputsourcedef>
<name>MY_ENGLISH</name>
<inputsourceid_prefix>
com.apple.keylayout.US
</inputsourceid_prefix>
</inputsourcedef>
<vkchangeinputsourcedef>
<name>KeyCode::VK_CHANGE_INPUTSOURCE_MY_CHINESE</name>
<inputsourceid_equal>
com.apple.inputmethod.SCIM.ITABC
</inputsourceid_equal>
</vkchangeinputsourcedef>
<vkchangeinputsourcedef>
<name>KeyCode::VK_CHANGE_INPUTSOURCE_MY_ENGLISH</name>
<inputsourceid_equal>
com.apple.keylayout.US
</inputsourceid_equal>
</vkchangeinputsourcedef>
<item>
<name>Change Input from English to Chinese by Tapping SHIFT_R</name>
<identifier>private.inputEngToChs</identifier>
<inputsource_only>MY_ENGLISH</inputsource_only>
<autogen>
__KeyOverlaidModifier__
KeyCode::SHIFT_R, ModifierFlag::SHIFT_R | ModifierFlag::NONE,
KeyCode::SHIFT_R,
KeyCode::SPACE, ModifierFlag::COMMAND_L | ModifierFlag::NONE
</autogen>
</item>
<item>
<name>Change Input from Chinese to English by Tapping SHIFT_R</name>
<identifier>private.inputChsToEng</identifier>
<inputsource_only>MY_CHINESE</inputsource_only>
<autogen>
__KeyOverlaidModifier__
KeyCode::SHIFT_R, ModifierFlag::SHIFT_R | ModifierFlag::NONE,
KeyCode::SHIFT_R,
KeyCode::SPACE, ModifierFlag::COMMAND_L | ModifierFlag::NONE
</autogen>
</item>
</root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment