Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
403 lines (360 sloc) 16.3 KB
<?xml version="1.0"?>
<root>
<!-- This is what you need to know about key transformations that occur -->
<!-- when `Karabiner` aka `KeyRemap4macbook` gets in the middle. Keys are -->
<!-- effectively of two types: -->
<!-- -->
<!-- [osx] this is what OS receives and essentially what you believe you -->
<!-- press, as in when sending Cmd-F (OSX find) it is the meaning not the -->
<!-- physical keys you have in mind, the actual physical keys pressed and -->
<!-- thus bytes generated can have different names spelled out on your -->
<!-- physical keyboard. You can think of [osx] as essence, meaning. -->
<!-- -->
<!-- [raw] is the actual raw keycode (byte) being sent - mapping between -->
<!-- the physical key you pressed and the byte (number) generated. So as to -->
<!-- avoid dealing with hexadecimal constants Karabiner gives them -->
<!-- names. E.g.: [ENTER] is 0x4c. Everywhere you see a Karabiner name you -->
<!-- should mentally think of it as a corresponding number or a physical -->
<!-- key. Think of names as placeholders or representations, not -->
<!-- meaning. These may later be mapped to something entirely different and -->
<!-- passed to your OS for further interpretation. -->
<!-- -->
<!-- NB: If you don't do anything fancy with your layout and you have a -->
<!-- standard QWERTY En keyboard chances are [osx] and [raw] will map onto -->
<!-- each other perfectly. Since this is the default we get really confused -->
<!-- when different layouts get into play, or seperate keys are re-mapped -->
<!-- to something different. If you remember one thing about Karabiner make -->
<!-- it this: it only deals with [raw] keys, which are referenced by their -->
<!-- names. This last point is the source of confusion, so always think: -->
<!-- name refers to a constant, not the meaning my mind is trying to attach -->
<!-- to it. Don't let your mind trick you. Who knew that phylosophy can be -->
<!-- so useful. -->
<!-- -->
<!-- Transformations: -->
<!-- -->
<!-- * [osx] -(1)- [raw] -(2)- [raw] -(3)- [osx] -->
<!-- -->
<!-- * [osx] -(in your head)- [raw] -(Karabiner)- [raw] -(in your head)- [osx] -->
<!-- -->
<!-- * Since -(2)- aka Karabiner only deals with [raw] this is what we need -->
<!-- to provide it. Unfortunately this is where you'll need to do the -->
<!-- mapping in your head: keys you want to send -(1)- and keys you want -->
<!-- received by OS -(3)- need to be mapped to physical [raw] keys on the -->
<!-- keyboard. -->
<!-- -->
<!-- __Example__ -->
<!-- -->
<!-- * My physical keyboard is a standard Macbook Air American-English -->
<!-- QWERTY -->
<!-- -->
<!-- * However, I chose Dvorak layout in OS X System Prefs, so having -->
<!-- received a physical signal OS will preform transformation to -->
<!-- Dvorak. I.e. physical signal marked semicolon `;` on my keyboard will -->
<!-- translate into letter `s` by OSX. -->
<!-- -->
<!-- * Now let's remap something with Karabiner. I want to be able to open -->
<!-- a search box (OS X find that's envoked with Command-f) by typing -->
<!-- Control-s on my Dvorak layout that is: [osx:C-s] to [osx: CMD-f] -->
<!-- -->
<!-- * put differently [osx:C-s] [raw:???] -(Karabiner)- [raw:???] [osx:CMD-f] -->
<!-- -->
<!-- * simple but easily corruptable way to replace those ??? is to look at -->
<!-- the names spelled out on the keys you press to get at C-s and CMD-f -->
<!-- when typing Dvorak. Most of the time this is what you want and you'll -->
<!-- arrive at the right answer -->
<!-- -->
<!-- * a bullet-proof way however is to use Karabiner's EventViewer to see -->
<!-- the KeyCodes generated. My advice go with phisical experiment no -->
<!-- guessing and hoping, it's not theoretical physics. -->
<!-- -->
<!-- * [osx:C-s] == [raw:C-SEMICOLON] to [raw:CMD-Y] == [osx:CMD-f] -->
<!-- Custom zeRusski layouts -->
<inputsourcedef>
<name>ZEDVORAK</name>
<inputsourceid_prefix>org.unknown.keylayout.zeDvorak14</inputsourceid_prefix>
</inputsourcedef>
<vkchangeinputsourcedef>
<name>KeyCode::VK_CHANGE_INPUTSOURCE_ZEDVORAK</name>
<inputsourceid_equal>org.unknown.keylayout.zeDvorak14</inputsourceid_equal>
</vkchangeinputsourcedef>
<!-- MS external keyboard -->
<devicevendordef>
<vendorname>MS</vendorname>
<vendorid>0x045e</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>MS_KEYBOARD</productname>
<productid>0x07a5</productid>
</deviceproductdef>
<item>
<name>vkz</name>
<item>
<name>Better DELETE and RETURN</name>
<appendix>6 sends RETURN</appendix>
<appendix>7 sends DELETE</appendix>
<identifier>private.better_delete_return</identifier>
<autogen>
__KeyToKey__
KeyCode::KEY_6,
KeyCode::RETURN,
</autogen>
<autogen>
__KeyToKey__
KeyCode::KEY_7,
KeyCode::DELETE,
</autogen>
</item>
<item>
<name>CapsLock and RETURN</name>
<appendix> CAPSLOCK alone acts as CAPSLOCK. </appendix>
<appendix> with other keys doubles as Option</appendix>
<appendix> ------------------------------------------------ </appendix>
<appendix> NB CAPSLOCK needs to be remapped to F19 in Seil. </appendix>
<appendix> NB Set CAPSLOCK to NO ACTION in System Settings. </appendix>
<appendix> ------------------------------------------------ </appendix>
<appendix> ------------------------------------------------ </appendix>
<appendix> NB There is physical limitation of the Mac keyboard </appendix>
<appendix> NB where CapsLock + SPACE + some keys won't register </appendix>
<appendix> NB So faking C-M-f won't work unfortunately </appendix>
<appendix> ------------------------------------------------ </appendix>
<identifier>private.capslock</identifier>
<autogen>
__KeyOverlaidModifier__
KeyCode::F19,
KeyCode::OPTION_L,
KeyCode::CAPSLOCK,
</autogen>
</item>
<item>
<name>Numeric keypad with Fn</name>
<appendix>Overlay 1234567890 under right-hand</appendix>
<identifier>private.fn_numbers</identifier>
<!-- <autogen>__KeyToKey__ KeyCode::KEY_9, KeyCode::MINUS</autogen> -->
<!-- <autogen>__KeyToKey__ KeyCode::KEY_0, KeyCode::EQUAL</autogen> -->
<!-- <autogen>__KeyToKey__ KeyCode::U, KeyCode::KEY_1</autogen> -->
<!-- <autogen>__KeyToKey__ KeyCode::I, KeyCode::KEY_2</autogen> -->
<!-- <autogen>__KeyToKey__ KeyCode::O, KeyCode::KEY_3</autogen> -->
<!-- Home row: 1, 2, 3 -->
<autogen>__KeyToKey__ KeyCode::J, ModifierFlag::FN, KeyCode::M, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::K, ModifierFlag::FN, KeyCode::COMMA, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::L, ModifierFlag::FN, KeyCode::DOT, ModifierFlag::OPTION_L</autogen>
<!-- Home row + 1 up: 4, 5, 6 -->
<autogen>__KeyToKey__ KeyCode::U, ModifierFlag::FN, KeyCode::J, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::I, ModifierFlag::FN, KeyCode::K, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::O, ModifierFlag::FN, KeyCode::L, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::KEY_7, ModifierFlag::FN, KeyCode::U, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::KEY_8, ModifierFlag::FN, KeyCode::I, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::KEY_9, ModifierFlag::FN, KeyCode::O, ModifierFlag::OPTION_L</autogen>
<!-- <autogen>__KeyToKey__ KeyCode::K, KeyCode::KEY_5</autogen> -->
<!-- <autogen>__KeyToKey__ KeyCode::L, KeyCode::KEY_6</autogen> -->
<!-- <autogen>__KeyToKey__ KeyCode::M, KeyCode::KEY_7</autogen> -->
<!-- <autogen>__KeyToKey__ KeyCode::N, KeyCode::KEY_7</autogen> -->
<!-- <autogen>__KeyToKey__ KeyCode::COMMA, KeyCode::KEY_8</autogen> -->
<!-- <autogen>__KeyToKey__ KeyCode::DOT, KeyCode::KEY_9</autogen> -->
<!-- <autogen>__KeyToKey__ KeyCode::H, KeyCode::KEY_0</autogen> -->
</item>
<item>
<name>Command - Space or Shift - Control</name>
<identifier>private.spaceshift</identifier>
<appendix>Command - Space or Shift - Control</appendix>
<block>
<autogen>
__KeyOverlaidModifier__
KeyCode::OPTION_L,
KeyCode::OPTION_L,
KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON,
KeyCode::VK_STICKY_OPTION_L,
</autogen>
</block>
<block>
<autogen>
__KeyOverlaidModifier__
KeyCode::COMMAND_L,
KeyCode::COMMAND_L,
KeyCode::N, ModifierFlag::SHIFT_L, ModifierFlag::CONTROL_L,
<!-- KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON, -->
<!-- KeyCode::VK_STICKY_CONTROL_L, -->
</autogen>
</block>
<block>
<autogen>
__KeyOverlaidModifier__
KeyCode::SPACE,
KeyCode::SHIFT_L,
KeyCode::SPACE
</autogen>
</block>
<block>
<autogen>
__KeyOverlaidModifier__
KeyCode::COMMAND_R,
KeyCode::CONTROL_L,
KeyCode::Y, ModifierFlag::SHIFT_L, ModifierFlag::CONTROL_L,
<!-- KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON, -->
<!-- KeyCode::VK_STICKY_CONTROL_L, -->
</autogen>
</block>
<block>
<autogen>
__KeyOverlaidModifier__
KeyCode::OPTION_R,
KeyCode::OPTION_R,
KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON,
KeyCode::VK_STICKY_OPTION_R,
</autogen>
</block>
<autogen>
__KeyOverlaidModifier__
KeyCode::SHIFT_L,
KeyCode::COMMAND_R,
KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON,
KeyCode::VK_STICKY_COMMAND_R,
</autogen>
<autogen>
__KeyOverlaidModifier__
KeyCode::SHIFT_R,
KeyCode::CONTROL_R,
KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON,
KeyCode::VK_STICKY_CONTROL_R,
</autogen>
<block>
<device_only>DeviceVendor::MS, DeviceProduct::MS_KEYBOARD</device_only>
<autogen>
__KeyOverlaidModifier__
KeyCode::PC_APPLICATION,
KeyCode::OPTION_L,
KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON,
KeyCode::VK_STICKY_OPTION_L,
</autogen>
<autogen>
__KeyToKey__
KeyCode::OPTION_R,
KeyCode::CONTROL_L
</autogen>
</block>
</item>
<item>
<name>Crazy overlaid sticky COMMAND and SHIFT</name>
<appendix>Hold COMMAND to get COMMAND</appendix>
<appendix>Type COMMAND to get sticky SHIFT</appendix>
<appendix>Hold SHIFT to get OPTION</appendix>
<appendix>Type SHIFT to get sticky OPTION</appendix>
<identifier>private.crazy_command_shift</identifier>
<autogen>
__KeyOverlaidModifier__
KeyCode::COMMAND_R,
KeyCode::SHIFT_R,
KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON,
KeyCode::VK_STICKY_SHIFT_R,
</autogen>
<!-- <autogen> -->
<!-- __KeyOverlaidModifier__ -->
<!-- KeyCode::COMMAND_L, -->
<!-- KeyCode::COMMAND_L, -->
<!-- KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON, -->
<!-- KeyCode::VK_STICKY_SHIFT_L, -->
<!-- </autogen> -->
<autogen>
__KeyOverlaidModifier__
KeyCode::COMMAND_L,
KeyCode::SHIFT_L,
KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON,
KeyCode::VK_STICKY_SHIFT_L,
</autogen>
<autogen>
__KeyOverlaidModifier__
KeyCode::SHIFT_R,
KeyCode::OPTION_L,
KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON,
KeyCode::VK_STICKY_OPTION_L,
</autogen>
<autogen>
__KeyOverlaidModifier__
KeyCode::SHIFT_L,
KeyCode::OPTION_L,
KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON,
KeyCode::VK_STICKY_OPTION_L,
</autogen>
<autogen>
--KeyToKey--
KeyCode::OPTION_L,
KeyCode::COMMAND_L,
</autogen>
<block>
<device_only>DeviceVendor::APPLE_COMPUTER, DeviceProduct::ANY</device_only>
<autogen>
--KeyToKey--
KeyCode::OPTION_R,
KeyCode::COMMAND_R,
</autogen>
</block>
<block>
<device_only>DeviceVendor::MS, DeviceProduct::MS_KEYBOARD</device_only>
<autogen>
--KeyToKey--
KeyCode::PC_APPLICATION,
KeyCode::COMMAND_L,
</autogen>
</block>
</item>
<include path="{{ ENV_HOME }}/.personal-configs/vm.xml" />
<item>
<name>Overlaid Comma</name>
<appendix>Holding , is holding OPTION</appendix>
<identifier>private.holding_comma</identifier>
<autogen>
__KeyOverlaidModifier__
KeyCode::W,
KeyCode::OPTION_L,
KeyCode::W,
</autogen>
</item>
<item>
<name>Overlaid SPACE</name>
<appendix>Insert SPACE when typed alone</appendix>
<appendix>CONTROL in key combinations</appendix>
<identifier>private.space_to_control_space</identifier>
<autogen>__KeyOverlaidModifier__ KeyCode::SPACE, KeyCode::CONTROL_L, KeyCode::SPACE</autogen>
</item>
<item>
<name>Fix COMMAND_R on MS (crazy)</name>
<identifier>private.option_r</identifier>
<device_only>DeviceVendor::MS, DeviceProduct::MS_KEYBOARD</device_only>
<autogen>
__KeyOverlaidModifier__
KeyCode::OPTION_R,
KeyCode::SHIFT_R,
KeyCode::VK_STICKY_ACTIVE_MODIFIERS_FORCE_ON,
KeyCode::VK_STICKY_SHIFT_R,
</autogen>
</item>
<item>
<name>CONTROL-m sends RETURN.</name>
<identifier>private.global_command_m</identifier>
<not>FINDER</not>
<autogen>
--KeyToKey--
KeyCode::M, ModifierFlag::CONTROL_L,
KeyCode::RETURN
</autogen>
</item>
<item>
<name>Chrome: tabs and windows, close tabs</name>
<identifier>private.chorme_switching</identifier>
<only>GOOGLE_CHROME</only>
<autogen>
__KeyToKey__
KeyCode::DELETE, ModifierFlag::COMMAND_L,
KeyCode::BACKQUOTE, ModifierFlag::COMMAND_L,
</autogen>
<autogen>
__KeyToKey__
KeyCode::DELETE, ModifierFlag::CONTROL_L,
KeyCode::TAB, ModifierFlag::CONTROL_L,
</autogen>
</item>
<include path="{{ ENV_HOME }}/.personal-configs/emacs-global.xml" />
<!-- <include path="{{ ENV_HOME }}/.personal-configs/numbers.xml" /> -->
<include path="{{ ENV_HOME }}/.personal-configs/vkz-launcher.xml" />
</item>
</root>