Skip to content

Instantly share code, notes, and snippets.

@hnakamur
Last active August 29, 2015 14:19
Show Gist options
  • Save hnakamur/1fdddb868558e28b9364 to your computer and use it in GitHub Desktop.
Save hnakamur/1fdddb868558e28b9364 to your computer and use it in GitHub Desktop.
My key mappings for Karabiner to activate apps with shortcut keys
<?xml version="1.0"?>
<root>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_APP_Firefox</name>
<url type="file">/Applications/Firefox.app</url>
</vkopenurldef>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_APP_Finder</name>
<url type="file">/System/Library/CoreServices/Finder.app</url>
</vkopenurldef>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_APP_Google_Chrome</name>
<url type="file">/Applications/Google Chrome.app</url>
</vkopenurldef>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_APP_iTerm</name>
<url type="file">/Applications/iTerm.app</url>
</vkopenurldef>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_APP_MacPass</name>
<url type="file">/Applications/MacPass.app</url>
</vkopenurldef>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_APP_MacVim</name>
<url type="file">/Applications/MacVim.app</url>
</vkopenurldef>
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_APP_Safari</name>
<url type="file">/Applications/Safari.app</url>
</vkopenurldef>
<item>
<name>Map ⌘^e to activate Firefox</name>
<identifier>private.command_control_e</identifier>
<autogen>
__KeyToKey__
KeyCode::E, ModifierFlag::COMMAND_L, ModifierFlag::CONTROL_L,
KeyCode::VK_OPEN_URL_APP_Firefox,
</autogen>
</item>
<item>
<name>Map ⌘^r to activate Finder</name>
<identifier>private.command_control_r</identifier>
<autogen>
__KeyToKey__
KeyCode::R, ModifierFlag::COMMAND_L, ModifierFlag::CONTROL_L,
KeyCode::VK_OPEN_URL_APP_Finder,
</autogen>
</item>
<item>
<name>Map ⌘^c to activate Google Chrome</name>
<identifier>private.command_control_c</identifier>
<autogen>
__KeyToKey__
KeyCode::C, ModifierFlag::COMMAND_L, ModifierFlag::CONTROL_L,
KeyCode::VK_OPEN_URL_APP_Google_Chrome,
</autogen>
</item>
<item>
<name>Map ⌘^t to activate iTerm</name>
<identifier>private.command_control_t</identifier>
<autogen>
__KeyToKey__
KeyCode::T, ModifierFlag::COMMAND_L, ModifierFlag::CONTROL_L,
KeyCode::VK_OPEN_URL_APP_iTerm,
</autogen>
</item>
<item>
<name>Map ⌘^1 to activate MacPass</name>
<identifier>private.command_control_1</identifier>
<autogen>
__KeyToKey__
KeyCode::KEY_1, ModifierFlag::COMMAND_L, ModifierFlag::CONTROL_L,
KeyCode::VK_OPEN_URL_APP_MacPass,
</autogen>
</item>
<item>
<name>Map ⌘^v to activate MacVim</name>
<identifier>private.command_control_v</identifier>
<autogen>
__KeyToKey__
KeyCode::V, ModifierFlag::COMMAND_L, ModifierFlag::CONTROL_L,
KeyCode::VK_OPEN_URL_APP_MacVim,
</autogen>
</item>
<item>
<name>Map ⌘^s to activate Safari</name>
<identifier>private.command_control_s</identifier>
<autogen>
__KeyToKey__
KeyCode::S, ModifierFlag::COMMAND_L, ModifierFlag::CONTROL_L,
KeyCode::VK_OPEN_URL_APP_Safari,
</autogen>
</item>
</root>
@hnakamur
Copy link
Author

数字のキーのキーコードは例えば1なら KeyCode::KEY_1 と書きます。
詳細はprivate.xml Reference Manualを参照してください。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment