Skip to content

Instantly share code, notes, and snippets.

@luosky
Last active December 21, 2015 10:39
Show Gist options
  • Save luosky/6293221 to your computer and use it in GitHub Desktop.
Save luosky/6293221 to your computer and use it in GitHub Desktop.
KeyRemap4MacBook 配置文件 private.xml
<?xml version="1.0"?>
<root>
<item>
<name>HHKB adopt Hyper settings</name>
<identifier>luosky.hhkb_hyper</identifier>
<appendix>Option_R / TAB to Hyper (ctrl+shift+cmd+opt), press only once, send escape</appendix>
<appendix>Shift_L + DELETE => ForwardDelete</appendix>
<devicevendordef>
<vendorname>TOPRE</vendorname>
<vendorid>0x0853</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>HHKB_PRO2_TYPES</productname>
<productid>0x0100</productid>
</deviceproductdef>
<device_only>DeviceVendor::TOPRE, DeviceProduct::HHKB_PRO2_TYPES</device_only>
<autogen>
--KeyOverlaidModifier--
KeyCode::TAB,
KeyCode::COMMAND_L,
ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L,
KeyCode::TAB
</autogen>
<autogen>
--KeyOverlaidModifier--
KeyCode::OPTION_R,
KeyCode::COMMAND_L,
ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L,
KeyCode::ESCAPE
</autogen>
<autogen>
--KeyToKey--
KeyCode::DELETE, ModifierFlag::SHIFT_L | ModifierFlag::NONE,
KeyCode::FORWARD_DELETE
</autogen>
<autogen>
--KeyToKey--
KeyCode::SLASH, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::CURSOR_DOWN
</autogen>
<autogen>
--KeyToKey--
KeyCode::SEMICOLON, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::CURSOR_UP
</autogen>
<autogen>
--KeyToKey--
KeyCode::DOT, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::CURSOR_LEFT
</autogen>
<autogen>
--KeyToKey--
KeyCode::SHIFT_R, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::CURSOR_RIGHT
</autogen>
</iterm>
<item>
<name>Hyper settings</name>
<appendix>Change F19 to Hyper</appendix>
<appendix>Hyper(cmd+ctrl+shift+opt)+J/K/H/L, send down/up/left/right</appendix>
<appendix>Hyper(cmd+ctrl+shift+opt)+space, send enter</appendix>
<appendix>Hyper(cmd+ctrl+shift+opt)+tab, send capslock</appendix>
<identifier>luosky.hyper</identifier>
<autogen>
--KeyOverlaidModifier--
KeyCode::F19,
KeyCode::COMMAND_L,
ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L,
KeyCode::ESCAPE
</autogen>
<autogen>
--KeyToKey--
KeyCode::J, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::CURSOR_DOWN
</autogen>
<autogen>
--KeyToKey--
KeyCode::K, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::CURSOR_UP
</autogen>
<autogen>
--KeyToKey--
KeyCode::H, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::CURSOR_LEFT
</autogen>
<autogen>
--KeyToKey--
KeyCode::L, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::CURSOR_RIGHT
</autogen>
<autogen>
--KeyToKey--
KeyCode::SPACE, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::ENTER
</autogen>
<autogen>
--KeyToKey--
KeyCode::TAB, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::CAPSLOCK
</autogen>
</item>
<item>
<name>fast input source switch</name>
<appendix>Change input source to US by command + space</appendix>
<appendix>Change input source to Baidu by command + alt + space</appendix>
<identifier>luosky.change_input_source_to_us</identifier>
<vkchangeinputsourcedef>
<name>KeyCode::VK_CHANGE_INPUTSOURCE_BAIDU</name>
<inputsourceid_equal>com.baidu.inputmethod.BaiduIM.pinyin</inputsourceid_equal>
</vkchangeinputsourcedef>
<autogen>
__KeyToKey__
KeyCode::SPACE, ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::VK_CHANGE_INPUTSOURCE_US
</autogen>
<autogen>
__KeyToKey__
KeyCode::SPACE, ModifierFlag::COMMAND_L | ModifierFlag::OPTION_L | ModifierFlag::NONE,
KeyCode::VK_CHANGE_INPUTSOURCE_BAIDU
</autogen>
</item>
<item>
<name>hyper + q to open QQ, press again to hide QQ</name>
<identifier>luosky.hyper_qq</identifier>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_APP_QQ</name>
<url>file:///Applications/QQ.app</url>
</vkopenurldef>
<appdef>
<appname>APP_QQ</appname>
<equal>com.tencent.qq</equal>
</appdef>
<list>
<item>
<name>Change hyper + q to open QQ</name>
<identifier>luosky.hyper_q_qq</identifier>
<not>APP_QQ</not>
<autogen>
__KeyToKey__
KeyCode::Q, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::VK_OPEN_URL_APP_QQ
</autogen>
</item>
<item>
<name>Change hyper + q to hide QQ in QQ</name>
<identifier>luosky.hyper_q_hide_qq</identifier>
<only>APP_QQ</only>
<autogen>
__KeyToKey__
KeyCode::Q, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L | ModifierFlag::CONTROL_L | ModifierFlag::COMMAND_L,
KeyCode::H, ModifierFlag::COMMAND_L
</autogen>
</item>
</list>
</item>
</root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment