Skip to content

Instantly share code, notes, and snippets.

@jgrodziski
Last active December 15, 2015 08:09
Show Gist options
  • Save jgrodziski/5228788 to your computer and use it in GitHub Desktop.
Save jgrodziski/5228788 to your computer and use it in GitHub Desktop.
This is my modified private.xml that remap the 'shift' key to left and right paren respectively. Then 'cmd+shift' to [, 'alt-shift' to { (same for the right side). Very useful for all non-US keyboardist like me (french layout! definitely not one for hacker)
<?xml version="1.0"?>
<root>
<item>
<name>Use the correct shift keys.</name>
<identifier>private.correct_shift_keys</identifier>
<autogen>--KeyToKey-- KeyCode::Q, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::W, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::E, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::R, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::T, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::A, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::S, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::D, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::F, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::G, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::Z, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::X, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::C, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::V, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::Y, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::U, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::I, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::O, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::P, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::H, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::J, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::K, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::L, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::SEMICOLON, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::N, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::M, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::COMMA, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::DOT, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::QUOTE, ModifierFlag::SHIFT_R, KeyCode::VK_NONE</autogen>
</item>
<item>
<name>Shifts to Parentheses, Option-Shift to {, ctrl-shift to [</name>
<appendix>Shifts, when pressed alone, type parentheses. When used with other keys they're normal shifts.</appendix>
<identifier>private.shifts_to_parens</identifier>
<!-- This is the basic mapping. -->
<autogen>--KeyOverlaidModifier-- KeyCode::SHIFT_R, ModifierFlag::SHIFT_R | ModifierFlag::NONE, KeyCode::SHIFT_R, KeyCode::FRENCH_RIGHT_PAREN, ModifierFlag::NONE</autogen>
<autogen>--KeyOverlaidModifier-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_L | ModifierFlag::NONE, KeyCode::SHIFT_L, KeyCode::KEY_5, ModifierFlag::NONE</autogen>
<!--
Remap the "rolls" of () and )( because it's too easy to hit one
before finishing the other, and there's no other reason to be
pressing both shift keys at once anyway
-->
<autogen>--KeyToKey-- KeyCode::SHIFT_L, ModifierFlag::SHIFT_R, KeyCode::KEY_5, ModifierFlag::NONE, KeyCode::FRENCH_RIGHT_PAREN, ModifierFlag::NONE</autogen>
<autogen>--KeyToKey-- KeyCode::SHIFT_R, ModifierFlag::SHIFT_L, KeyCode::KEY_5, ModifierFlag::NONE, KeyCode::FRENCH_RIGHT_PAREN, ModifierFlag::NONE</autogen>
<!--
Remap Rshift+Space to ') ', because when typing an end paren and
then a space I tend to hit space before I let go of rshift.
-->
<!--<autogen>--KeyToKey-- KeyCode::SPACE, ModifierFlag::SHIFT_R, KeyCode::FRENCH_RIGHT_PAREN, ModifierFlag::NONE, KeyCode::SPACE</autogen>-->
<!-- for {}-->
<autogen>--KeyToKey-- KeyCode::SHIFT_L, ModifierFlag::OPTION_L, KeyCode::KEY_5, ModifierFlag::OPTION_L</autogen>
<autogen>--KeyToKey-- KeyCode::SHIFT_R, ModifierFlag::OPTION_R, KeyCode::FRENCH_RIGHT_PAREN, ModifierFlag::OPTION_L</autogen>
<!-- for [] -->
<autogen>--KeyToKey-- KeyCode::SHIFT_L, ModifierFlag::COMMAND_L, KeyCode::KEY_5, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_L</autogen>
<autogen>--KeyToKey-- KeyCode::SHIFT_R, ModifierFlag::COMMAND_R, KeyCode::FRENCH_RIGHT_PAREN, ModifierFlag::OPTION_L | ModifierFlag::SHIFT_R</autogen>
</item>
</root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment