<?xml version="1.0"?>
<root>
<item>
<name>Swap Space and Tab</name>
<identifier>private.swap_space_and_tab</identifier>
<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::TAB</autogen>
<autogen>__KeyToKey__ KeyCode::TAB, KeyCode::SPACE</autogen>
</item>
<item>
<name>Change Right Command Key to Escape</name>
<identifier>private.right_command_to_escape</identifier>
<autogen>__KeyToKey__ KeyCode::COMMAND_R, KeyCode::ESCAPE</autogen>
</item>
</root>
2 settings are added by this private.xml.
There are a lot of examples of <autogen> in "Samples for Karabiner Binding Developers" at
the bottom of Karabiner Prefs.
You can see the raw XML from samples.xml.
In addition, prepared settings are described in checkbox.xml.
These are also good examples of <autogen>.
The XML is also installed into your machine.
See /Applications/Karabiner.app/Contents/Resources/.
You can add a new setting by <item>.
<?xml version="1.0"?>
<root>
<item>
<name>Name of Setting</name>
<appendix>Optional Description of Setting</appendix>
<identifier>Unique Identifier of Setting</identifier>
<autogen>Behavior Definition</autogen>
<autogen>Behavior Definition</autogen>
</item>
<item>...</item>
<item>...</item>
</root>
Please write <name>, <identifier>,
<autogen> under <item>.
|
<name>
<appendix> |
These values are used in Preference Pane. |
|---|---|
| <identifier> |
This value is used to identify setting.
You need to specify a unique value. We recommend you to add a "private." prefix to your identifier. It prevents conflicts with identifiers of prepared settings. |
| <autogen> |
Definition of this setting behavior.
For example, __KeyToKey__, __PointingButtonToKey__. |
This <autogen> changes space key to tab key.
<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::TAB</autogen>
This <autogen> changes "left control+space key" to tab key.
<autogen> __KeyToKey__ KeyCode::SPACE, ModifierFlag::CONTROL_L, KeyCode::TAB </autogen>
This <autogen> changes "left control+space key" to "left control+tab key".
<autogen> __KeyToKey__ KeyCode::SPACE, ModifierFlag::CONTROL_L, KeyCode::TAB, ModifierFlag::CONTROL_L </autogen>
You can use "|" to specify multiple modifiers.
This <autogen> changes "left control+fn+space key" to tab key.
<autogen> __KeyToKey__ KeyCode::SPACE, ModifierFlag::CONTROL_L | ModifierFlag::FN, KeyCode::TAB </autogen>
If you want to change key behavior only when specific modifiers are pressed, use ModifierFlag::NONE.
This <autogen> changes "fn+space key" to tab key and retain other modifier combinations+space key behavior.
| Physical key | Changed key | State |
|---|---|---|
| space | space | Not changed |
| control+space | control+space | Not changed |
| fn+space | tab | Changed |
| fn+control+space | fn+control+space | Not changed |
<autogen> __KeyToKey__ KeyCode::SPACE, ModifierFlag::FN | ModifierFlag::NONE, KeyCode::TAB </autogen>
This <autogen> changes space key to tab,return key.
<autogen> __KeyToKey__ KeyCode::SPACE, KeyCode::TAB, KeyCode::RETURN </autogen>
Karabiner applies only the first matched <autogen>.
The following autogens change space key to tab key (not return key).
<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::TAB</autogen> <autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::RETURN</autogen>
If you want to change "shift+space to tab" and "space to return",
you need to order <autogen> as follows.
| Physical key | Changed key |
|---|---|
| shift+space | tab |
| space | return |
<!-- shift+space to tab --> <autogen>__KeyToKey__ KeyCode::SPACE, ModifierFlag::SHIFT_L, KeyCode::TAB</autogen> <!-- space to return --> <autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::RETURN</autogen>
Wrong case If you've put them in reverse order, Karabiner changes "shift+space" to "shift+return".
<!-- Karabiner always changes space key to return key even if you're pressing shift modifier. --> <autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::RETURN</autogen> <!-- *** This autogen is never applied. *** --> <autogen>__KeyToKey__ KeyCode::SPACE, ModifierFlag::SHIFT_L, KeyCode::TAB</autogen>
You can add a special behavior by using some prefix on <identifier>.
| Prefix | Behavior |
|---|---|
| notsave. |
"notsave." prefix is designed for creating "mode".
|
You can define settings which are effective in specific applications only.
Add <only> or <not> to your <item>.
This private.xml exchanges space key and tab key in Safari.
<?xml version="1.0"?>
<root>
<item>
<name>Swap Space and Tab</name>
<identifier>private.app_safari_swap_space_and_tab</identifier>
<only>SAFARI</only>
<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::TAB</autogen>
<autogen>__KeyToKey__ KeyCode::TAB, KeyCode::SPACE</autogen>
</item>
</root>
See "App" tab of EventViewer.
This list is updated when you changed the current application.
Change the current application to target application. Then press "copy to pasteboard" button.
You can paste this information to text area.
<appdef> to your private.xml.
<appname> is a name of application which you use in <only> filter.
<equal>.
<?xml version="1.0"?>
<root>
<appdef>
<appname>APPSTORE</appname>
<equal>com.apple.appstore</equal>
</appdef>
</root> <only>APPSTORE</only> in private.xml.
<?xml version="1.0"?>
<root>
<appdef>
<appname>APPSTORE</appname>
<equal>com.apple.appstore</equal>
</appdef>
<item>
<name>Space to Tab in App Store.app</name>
<identifier>private.appdef</identifier>
<only>APPSTORE</only>
<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::TAB</autogen>
</item>
</root>
Karabiner provides
various application definitions.
You can use them without <appdef> in private.xml.
You can also overwrite existent application definitions by private.xml.
If you overwrite TERMINAL definition as follows,
<only>TERMINAL</only> is effective in Apple's Terminal.app only
(not iTerm2 and other terminal apps).
<?xml version="1.0"?>
<root>
<appdef>
<appname>TERMINAL</appname>
<equal>com.apple.Terminal</equal>
</appdef>
</root>
You can define settings which are effective in specific window name only.
Add <windowname_only> or <windowname_not> to your <item>.
This private.xml disables command-w in Gmail on Google Chrome.
<?xml version="1.0"?>
<root>
<item>
<name>Disable command-w in Gmail on Google Chrome.</name>
<identifier>private.windowname_google_chrome_gmail_disable_close</identifier>
<only>GOOGLE_CHROME</only>
<windowname_only>Gmail</windowname_only>
<autogen>
__KeyToKey__
KeyCode::W, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND | ModifierFlag::NONE,
KeyCode::VK_NONE,
</autogen>
</item>
</root>
See "App" tab of EventViewer.
This list is updated when a window name is changed.
Focus target window. Then press "copy to pasteboard" button.
You can paste this information to text area.
<windownamedef> to your private.xml.
<name> is a name of definition which you use in <windowname_only> filter.
<regex>.
(regex patterns folow the ECMAScript syntax.)
<?xml version="1.0"?>
<root>
<windownamedef>
<name>Google_Search</name>
<regex> - Google Search$</regex>
</windownamedef>
</root> <windowname_only>Google_Search</windowname_only> in private.xml.
<?xml version="1.0"?>
<root>
<windownamedef>
<name>Google_Search</name>
<regex> - Google Search$</regex>
</windownamedef>
<item>
<name>Disable command-w in Google Search on Google Chrome.</name>
<identifier>private.windownamedef</identifier>
<windowname_only>Google_Search</windowname_only>
<autogen>
__KeyToKey__
KeyCode::W, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_COMMAND | ModifierFlag::NONE,
KeyCode::VK_NONE,
</autogen>
</item>
</root>
Karabiner provides
various window name definitions.
You can use them without <windownamedef> in private.xml.
You can also overwrite existent window name definitions by private.xml.
You can define settings which are effective in specific ui element role only.
It's useful when you want to make settings which are effective only if the focused element is text area (text field).
Add <uielementrole_only> or <uielementrole_not> to your <item>.
This private.xml changes hjkl keys to arrow keys in Finder.
And hjkl keys will not be modified if you are editing a file name.
<?xml version="1.0"?>
<root>
<item>
<name>Change hjkl keys to arrow keys in Finder</name>
<identifier>private.hjkl_keys_to_arrow_keys_in_finder</identifier>
<uielementrole_not>AXTextArea, AXTextField</uielementrole_not>
<only>FINDER</only>
<modifier_only>
ModifierFlag::NONE,
ModifierFlag::SHIFT_L | ModifierFlag::NONE,
ModifierFlag::SHIFT_R | ModifierFlag::NONE,
</modifier_only>
<autogen>__KeyToKey__ KeyCode::H, KeyCode::CURSOR_LEFT</autogen>
<autogen>__KeyToKey__ KeyCode::J, KeyCode::CURSOR_DOWN</autogen>
<autogen>__KeyToKey__ KeyCode::K, KeyCode::CURSOR_UP</autogen>
<autogen>__KeyToKey__ KeyCode::L, KeyCode::CURSOR_RIGHT</autogen>
</item>
</root>
You can confirm a focused ui element's role by EventViewer.
Karabiner provides various ui element role definitions.
You can also add your own ui element role by <uielementroledef> tag.
You can define settings which are effective on specific device only.
Add <device_only> or <device_not> to your <item>.
This private.xml turns scroll wheel off on Magic Mouse.
<?xml version="1.0"?>
<root>
<item>
<name>Disable ScrollWheel on Magic Mouse</name>
<identifier>private.dropscrollwheel_0x05ac_0x030d</identifier>
<device_only>DeviceVendor::APPLE_COMPUTER,DeviceProduct::MAGIC_MOUSE</device_only>
<autogen>__DropScrollWheel__</autogen>
</item>
</root>
See "Devices" tab of EventViewer.
Then press "copy to pasteboard" button.
You can paste this information to text area.
<devicevendordef> and <deviceproductdef> to your private.xml.
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>HEWLETT_PACKARD</vendorname>
<vendorid>0x03f0</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>MY_HP_KEYBOARD</productname>
<productid>0x0224</productid>
</deviceproductdef>
</root> <device_only> in private.xml.
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>HEWLETT_PACKARD</vendorname>
<vendorid>0x03f0</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>MY_HP_KEYBOARD</productname>
<productid>0x0224</productid>
</deviceproductdef>
<item>
<name>Space to Tab in MY_HP_KEYBOARD</name>
<identifier>private.deviceproductdef</identifier>
<device_only>DeviceVendor::HEWLETT_PACKARD, DeviceProduct::MY_HP_KEYBOARD</device_only>
<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::TAB</autogen>
</item>
</root>
Karabiner provides various Vendor ID and Product ID definitions.
You can use them without <devicevendordef> and
<deviceproductdef> in private.xml.
You can also overwrite existent device definitions by private.xml.
You can use "Location ID" in order to distinguish multiple devices which have same Vendor ID and Product ID.
| Device Type | What's Location ID? | Is immutable? |
|---|---|---|
| USB Device | Location ID is determined by USB port. | This value will be changed when you pull out USB device and plug it into other USB port. |
| Bluetooth Device | Location ID is determined by Bluetooth Address. | This value is immutable. |
You can examin Location ID by EventViewer.
You can specify Location ID like this.
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>HEWLETT_PACKARD</vendorname>
<vendorid>0x03f0</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>MY_HP_KEYBOARD</productname>
<productid>0x0224</productid>
</deviceproductdef>
<devicelocationdef>
<locationname>MY_HP_KEYBOARD_PRIMARY</locationname>
<locationid>0xfa120000</locationid>
</devicelocationdef>
<item>
<name>Space to Tab in MY_HP_KEYBOARD</name>
<identifier>private.deviceproductdef</identifier>
<device_only>
DeviceVendor::HEWLETT_PACKARD,
DeviceProduct::MY_HP_KEYBOARD,
DeviceLocation::MY_HP_KEYBOARD_PRIMARY,
</device_only>
<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::TAB</autogen>
</item>
</root> There are two functions related with input source.
This private.xml changes input source to Dvorak by Right Shift Key + D.
<?xml version="1.0"?>
<root>
<vkchangeinputsourcedef>
<name>KeyCode::VK_CHANGE_INPUTSOURCE_MY_DVORAK</name>
<inputsourceid_equal>com.apple.keylayout.Dvorak</inputsourceid_equal>
</vkchangeinputsourcedef>
<item>
<name>Change input source to Dvorak by right shift key + D</name>
<identifier>private.change_input_source_to_dvorak</identifier>
<autogen>
__KeyToKey__
KeyCode::D, ModifierFlag::SHIFT_R,
KeyCode::VK_CHANGE_INPUTSOURCE_MY_DVORAK
</autogen>
</item>
</root>
You can define new virtual key code by <vkchangeinputsourcedef>.
<name> is a name of virtual key code.
This name must be started with KeyCode::VK_CHANGE_INPUTSOURCE_.
For example, <name>KeyCode::VK_CHANGE_INPUTSOURCE_YOUR_LANGUAGE</name>.
<inputsourceid_equal> is a input source id of target input source.
How to examine input source id.
Karabiner provides
various virtual key code definitions.
You can use them without <vkchangeinputsourcedef> in private.xml.
This private.xml exchanges space key and tab key on Dvorak.
<?xml version="1.0"?>
<root>
<inputsourcedef>
<name>MY_DVORAK</name>
<inputsourceid_prefix>com.apple.keylayout.Dvorak</inputsourceid_prefix>
</inputsourcedef>
<item>
<name>Swap Space and Tab</name>
<identifier>private.my_dvorak_swap_space_and_tab</identifier>
<inputsource_only>MY_DVORAK</inputsource_only>
<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::TAB</autogen>
<autogen>__KeyToKey__ KeyCode::TAB, KeyCode::SPACE</autogen>
</item>
</root>
Examine Input Source ID of target input source.
How to examine input source id.
Add <inputsourcedef> your private.xml.
<?xml version="1.0"?>
<root>
<inputsourcedef>
<name>MY_DVORAK</name>
<inputsourceid_prefix>com.apple.keylayout.Dvorak</inputsourceid_prefix>
</inputsourcedef>
</root>
Then, you can use <inputsource_only> and <inputsource_not> in private.xml.
<?xml version="1.0"?>
<root>
<inputsourcedef>
<name>MY_DVORAK</name>
<inputsourceid_prefix>com.apple.keylayout.Dvorak</inputsourceid_prefix>
</inputsourcedef>
<item>
<name>Swap Space and Tab</name>
<identifier>private.my_dvorak_swap_space_and_tab</identifier>
<inputsource_only>MY_DVORAK</inputsource_only>
<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::TAB</autogen>
<autogen>__KeyToKey__ KeyCode::TAB, KeyCode::SPACE</autogen>
</item>
</root>
Karabiner provides various input source definitions.
You can use them without <inputsourcedef> in private.xml.
You can examine input source id by Event Viewer.
This private.xml opens web site, launches calculator and executes a shell command "/bin/date | /usr/bin/pbcopy".
<?xml version="1.0"?>
<root>
<!-- generic URL -->
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_WEB_karabiner</name>
<url>https://pqrs.org/osx/karabiner/</url>
</vkopenurldef>
<!-- file path -->
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_APP_Calculator</name>
<url type="file">/Applications/Calculator.app</url>
</vkopenurldef>
<!-- shell commands -->
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_SHELL_date_pbcopy</name>
<url type="shell">
<![CDATA[ /bin/date | /usr/bin/pbcopy ]]>
</url>
</vkopenurldef>
<item>
<name>Change right-command + w to open https://pqrs.org/osx/karabiner/</name>
<identifier>private.right_command_w</identifier>
<autogen>
__KeyToKey__
KeyCode::W, ModifierFlag::COMMAND_R,
KeyCode::VK_OPEN_URL_WEB_karabiner,
</autogen>
</item>
<item>
<name>Change right-command + c to launch calculator</name>
<identifier>private.right_command_c</identifier>
<autogen>
__KeyToKey__
KeyCode::C, ModifierFlag::COMMAND_R,
KeyCode::VK_OPEN_URL_APP_Calculator,
</autogen>
</item>
<item>
<name>Change right-command + d to execute /bin/date | /usr/bin/pbcopy</name>
<identifier>private.right_command_d</identifier>
<autogen>
__KeyToKey__
KeyCode::D, ModifierFlag::COMMAND_R,
KeyCode::VK_OPEN_URL_SHELL_date_pbcopy,
</autogen>
</item>
</root>
You can define new virtual key code by <vkopenurldef>.
<name> is a name of virtual key code.
This name must be started with KeyCode::VK_OPEN_URL_.
For example, <name>KeyCode::VK_OPEN_URL_Yourapp</name>.
<url> is a url of virtual key code.
<url> has a "type" attribute which determines how treat the value.
| Type attribute | Description |
|---|---|
| (empty) | If you does not specify a type attribute, it will be treated as a generic URL. |
| type="file" | The value will be treated as file path. |
| type="shell" | The value will be treated as shell commands. |
Karabiner provides
various virtual key code definitions.
You can use them without <vkopenurldef> in private.xml.
You can include external xml files by <include>.
<?xml version="1.0"?> <root> <include path="core.xml" /> </root>core.xml
<?xml version="1.0"?>
<root>
<item>
<name>Swap Space and Tab</name>
<identifier>private.swap_space_and_tab</identifier>
<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::TAB</autogen>
<autogen>__KeyToKey__ KeyCode::TAB, KeyCode::SPACE</autogen>
</item>
</root>
You can synchronize your private.xml by Dropbox or other file syncing service.
private.xml<?xml version="1.0"?>
<root>
<include path="{{ ENV_HOME }}/Dropbox/private/Karabiner/core.xml" />
</root>
Dropbox/private/Karabiner/core.xml
<?xml version="1.0"?>
<root>
<item>
<name>Dropbox Test!</name>
</item>
</root>
<replacementdef> in <include> has a local scope.
These <replacementdef> are effective only in included file.
<?xml version="1.0"?>
<root>
<!-- Swap Space and Escape -->
<include path="core.xml">
<replacementdef>
<replacementname>KEY1</replacementname>
<replacementvalue>KeyCode::SPACE</replacementvalue>
</replacementdef>
<replacementdef>
<replacementname>KEY2</replacementname>
<replacementvalue>KeyCode::ESCAPE</replacementvalue>
</replacementdef>
</include>
<!-- Swap Tab and Return -->
<include path="core.xml">
<replacementdef>
<replacementname>KEY1</replacementname>
<replacementvalue>KeyCode::TAB</replacementvalue>
</replacementdef>
<replacementdef>
<replacementname>KEY2</replacementname>
<replacementvalue>KeyCode::RETURN</replacementvalue>
</replacementdef>
</include>
</root>
core.xml
<?xml version="1.0"?>
<root>
<item>
<name>Swap {{ KEY1 }} and {{ KEY2 }}</name>
<identifier>private.swap_{{ KEY1 }}_{{ KEY2 }}</identifier>
<autogen>__KeyToKey__ {{ KEY1 }}, {{ KEY2 }}</autogen>
<autogen>__KeyToKey__ {{ KEY2 }}, {{ KEY1 }}</autogen>
</item>
</root>
You can define replacement by <replacementdef>.
<?xml version="1.0"?>
<root>
<replacementdef>
<replacementname>MY_IGNORE_APPS</replacementname>
<replacementvalue>SAFARI, FIREFOX, FINDER</replacementvalue>
</replacementdef>
<item>
<name>Change space to tab except in my ignore apps.</name>
<identifier>private.space_to_tab_except_my_ignore_apps</identifier>
<not>{{ MY_IGNORE_APPS }}</not>
<autogen>__KeyToKey__ KeyCode::SPACE, KeyCode::TAB</autogen>
</item>
</root>
{{ <replacementname> }} is replaced by <replacementvalue>.
<not>{{ MY_IGNORE_APPS }}</not>
<!-- ↑ is replaced to ↓ -->
<not>SAFARI, FIREFOX, FINDER</not>
<replacementdef> written in private.xml has a global scope.
It is effective for the entire XML.
When you wrote multiple <replacementdef> for one <replacementname>,
only the first one is effective.
<?xml version="1.0"?>
<root>
<replacementdef>
<replacementname>MY_KEYCODE</replacementname>
<replacementvalue>KeyCode::SPACE</replacementvalue>
</replacementdef>
<!-- This replacementdef of MY_KEYCODE is ignored -->
<replacementdef>
<replacementname>MY_KEYCODE</replacementname>
<replacementvalue>KeyCode::TAB</replacementvalue>
</replacementdef>
<item>
<name>{{ MY_KEYCODE }} is KeyCode::SPACE</name>
</item>
</root>
You can define a local scope replacement
by using <replacementdef> under <include>.
See
<include> with <replacementdef> section.
Karabiner provides
various replacement definitions.
You can use them without <replacementdef> in private.xml.
You can also overwrite existent replacement definitions by private.xml.
An example of overwriting VI_H:
<?xml version="1.0"?>
<root>
<replacementdef>
<replacementname>VI_H</replacementname>
<replacementvalue>KeyCode::J</replacementvalue>
</appdef>
</root>
You can define new KeyCode by <symbol_map>.
<?xml version="1.0"?>
<root>
<symbol_map type="KeyCode" name="MY_LANGUAGE_KEY" value="0x32" />
<item>
<name>Change KeyCode::MY_LANGUAGE_KEY to tab.</name>
<identifier>private.my_language_key_to_tab</identifier>
<autogen>__KeyToKey__ KeyCode::MY_LANGUAGE_KEY, KeyCode::TAB</autogen>
</item>
</root>
You can specify a raw value by using KeyCode::RawValue.
<?xml version="1.0"?>
<root>
<item>
<name>Change right option key to tab key</name>
<identifier>private.right_option_key_to_tab_key</identifier>
<!-- change right option key (0x3d) to tab key (0x30) -->
<autogen>__KeyToKey__ KeyCode::RawValue::0x3d, KeyCode::RawValue::0x30</autogen>
</item>
</root>
You can define new virtual modifier by <modifierdef>.
<?xml version="1.0"?>
<root>
<modifierdef>MY_HYPER</modifierdef>
<modifierdef>MY_SUPER</modifierdef>
<item>
<name>My hyper and super key</name>
<appendix>* Change the right shift key to my hyper key.</appendix>
<appendix>* Change the right option key to my super key.</appendix>
<appendix></appendix>
<appendix>* Change hyper+a,s to 1,2.</appendix>
<appendix>* Change super+a,s to brightness controls.</appendix>
<identifier>private.hyper_super</identifier>
<!-- Change the right shift key to my hyper key. -->
<autogen>__KeyToKey__ KeyCode::SHIFT_R, KeyCode::VK_MODIFIER_MY_HYPER</autogen>
<!-- Change the right option key to my super key. -->
<autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::VK_MODIFIER_MY_SUPER</autogen>
<!-- hyper key settings -->
<autogen>
__KeyToKey__
KeyCode::A, ModifierFlag::MY_HYPER,
KeyCode::KEY_1,
</autogen>
<autogen>
__KeyToKey__
KeyCode::S, ModifierFlag::MY_HYPER,
KeyCode::KEY_2,
</autogen>
<!-- super key settings -->
<autogen>
__KeyToKey__
KeyCode::A, ModifierFlag::MY_SUPER,
ConsumerKeyCode::BRIGHTNESS_DOWN,
</autogen>
<autogen>
__KeyToKey__
KeyCode::S, ModifierFlag::MY_SUPER,
ConsumerKeyCode::BRIGHTNESS_UP,
</autogen>
</item>
</root>
<modifierdef> adds some KeyCode and ModifierFlag.
For generic usage, ModifierFlag::MY_HYPER and KeyCode::VK_MODIFIER_MY_HYPER are important.
(Replace MY_HYPER with your own modifier's name.)
These are full KeyCode and ModifierFlag that added by <modifierdef>MY_HYPER</modifierdef>:
| KeyCode or ModifierFlag | Description |
|---|---|
| ModifierFlag::MY_HYPER | ModifierFlag for new modifier. |
| KeyCode::VK_MODIFIER_MY_HYPER | KeyCode for new modifier. |
| KeyCode::VK_LOCK_MY_HYPER | KeyCode to toggle new modifier lock. |
| KeyCode::VK_LOCK_MY_HYPER_FORCE_ON | KeyCode to turn new modifier lock on. |
| KeyCode::VK_LOCK_MY_HYPER_FORCE_OFF | KeyCode to turn new modifier lock off. |
| KeyCode::VK_NEGATIVE_LOCK_MY_HYPER | KeyCode to toggle new modifier negative lock. |
| KeyCode::VK_NEGATIVE_LOCK_MY_HYPER_FORCE_ON | KeyCode to turn new modifier negative lock on. |
| KeyCode::VK_NEGATIVE_LOCK_MY_HYPER_FORCE_OFF | KeyCode to turn new modifier negative lock off. |
| KeyCode::VK_STICKY_MY_HYPER | KeyCode to toggle new modifier sticky state. |
| KeyCode::VK_STICKY_MY_HYPER_FORCE_ON | KeyCode to turn new modifier sticky state on. |
| KeyCode::VK_STICKY_MY_HYPER_FORCE_OFF | KeyCode to turn new modifier sticky state off. |
Add notify="false" attribute to modifierdef
if you want to hide an indicator of modifier locks and sticky for new modifier.
<modifierdef notify="false">MY_HYPER2</modifierdef>
Without notify="false", Karabiner shows an indicator when your own modifier is locked.
Karabiner provides some prepared virtual modifier.
You can use them without <modifierdef> in private.xml.
$ cd src/core/server/Resources $ make install(This commands ask your password in order to modify XML files in /Applications/Karabiner.app.)