1

I want to map left_option to \, left command to / and right command to | when used alone. When used in combination with other keys I want the left_option, left command and right command to retain their functions. How do I do that?

1
<?xml version="1.0"?>
<root>
  <item>
    <name>L⌥→\&L⌘→/&R⌘→|</name>
    <identifier>alttobackslashcmdtoslashandpipe</identifier>
    <autogen>
      __KeyToKey__
      KeyCode::OPTION_L | ModifierFlag::NONE,
      KeyCode::BACKSLASH
    </autogen>
    <autogen>
      __KeyToKey__
      KeyCode::COMMAND_L | ModifierFlag::NONE,
      KeyCode::SLASH
    </autogen>
    <autogen>
      __KeyToKey__
      KeyCode::COMMAND_R | ModifierFlag::NONE,
      KeyCode::BACKSLASH | ModifierFlag::SHIFT
    </autogen>
  </item>
</root>

This might not have quite the effect you want, but it's as close as I know how to do.

  • Derp. Forgot that keys are different internationally. Since I can't check it I'll give you the accepted answer for now. – The Unfun Cat Aug 9 '14 at 16:26
1

With the kind help of Takayama Fumihiko, I was able to get it right for Norwegian layouts:

<item>
  <appendix>Remap OptionL to Backslash</appendix>
  <identifier>private.option_to_backslash</identifier>
  <autogen>
__KeyOverlaidModifier__
KeyCode::OPTION_L, ModifierFlag::OPTION_L | ModifierFlag::NONE,
KeyCode::OPTION_L, ModifierFlag::OPTION_L,
KeyCode::KEY_7, ModifierFlag::SHIFT_R | ModifierFlag::OPTION_L,
  </autogen>
</item>
<item>
  <appendix>Remap CommandL to Slash</appendix>
  <identifier>private.option_to_slash</identifier>
  <autogen>
__KeyOverlaidModifier__
KeyCode::COMMAND_L, ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::COMMAND_L, ModifierFlag::COMMAND_L,
KeyCode::KEY_7, ModifierFlag::SHIFT_R | ModifierFlag::NONE,
  </autogen>

</item>
<item>
  <appendix>Remap CommandR to Pipe</appendix>
  <identifier>private.commandr_to_pipe</identifier>
  <autogen>
__KeyOverlaidModifier__
KeyCode::COMMAND_R, ModifierFlag::COMMAND_R | ModifierFlag::NONE,
KeyCode::COMMAND_R, ModifierFlag::COMMAND_R,
KeyCode::KEY_7, ModifierFlag::OPTION_R | ModifierFlag::NONE,
  </autogen>

</item>

<item>
  <appendix>Remap OptionR to Tilde</appendix>
  <identifier>private.optionr_to_tilde</identifier>
  <autogen>
__KeyOverlaidModifier__
KeyCode::OPTION_R, ModifierFlag::OPTION_R | ModifierFlag::NONE,
KeyCode::OPTION_R, ModifierFlag::OPTION_R,
KeyCode::BRACKET_RIGHT, ModifierFlag::OPTION_R | ModifierFlag::NONE,
  </autogen>

</item>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .