How to remap Mac CMD to CTRL keys in Blender

keybindingskeyboard

I want to remap the command with the control in Blender application. I've tried using Karabiner and when I open it these are the default Blender options:

enter image description here

I wonder how I can add the command/control switch as well?

I've tried doing it by updating the private.xml file as shown below:

<?xml version="1.0"?>
<root>
    <item>
        <name>For Applications</name>
            <item>
                <name>Enable at only Blender</name>
                <identifier>private.swap_command_and_control</identifier>
                <autogen>__KeyToKey__ KeyCode::COMMAND_L, KeyCode::CONTROL_L</autogen>
                <autogen>__KeyToKey__ KeyCode::CONTROL_L, KeyCode::COMMAND_L</autogen>
            </item>
    </item>
</root>

But it's wrong as shown here:
enter image description here

I want it to be appearing under the blender application item as shown below. Any advice please?

enter image description here

Best Answer

Your private.xml is missing the only key and would swap the keys system-wide. Additionally you got the naming of the item wrong.

Here is a working private.xml:

<?xml version="1.0"?>
<root>
    <item>
        <name>Enable at only Blender - custom</name>
            <item>
                <name>Swap Command and Control</name>
                <identifier>private.swap_command_and_control</identifier>
                <only>BLENDER</only>
                <autogen>__KeyToKey__ KeyCode::COMMAND_L, KeyCode::CONTROL_L</autogen>
                <autogen>__KeyToKey__ KeyCode::CONTROL_L, KeyCode::COMMAND_L</autogen>
            </item>
    </item>
</root>

or if you want the "For applications" to appear in the private section:

<?xml version="1.0"?>
<root>
    <item>
        <name>For Applications</name>
        <item>
        <name>Enable at only Blender - custom</name>
            <item>
                <name>Swap Command and Control</name>
                <identifier>private.swap_command_and_control</identifier>
                <only>BLENDER</only>
                <autogen>__KeyToKey__ KeyCode::COMMAND_L, KeyCode::CONTROL_L</autogen>
                <autogen>__KeyToKey__ KeyCode::CONTROL_L, KeyCode::COMMAND_L</autogen>
            </item>
        </item>
    </item>
</root>

If you want the key mod to appear in the non-private part "For applications" you have to add it (the most inner item key including <item> and </item>) to the file: /Applications/Karabiner.app/Contents/Resources/include/checkbox/apps/blender.xml.

Any Karabiner update/upgrade will remove/overwrite your mod probably.

Example:

<?xml version="1.0"?>
<root>

  <item>
    <name>Enable at only Blender</name>

    <item>
      <name>FlipScrollWheel</name>
      <item>
        <name>Flip Horizontal and Vertical ScrollWheel at Blender</name>
        <identifier>remap.app_Blender_flipscrollwheel</identifier>
        <only>BLENDER</only>
        <autogen>
          __FlipScrollWheel__
          Option::FLIPSCROLLWHEEL_HORIZONTAL,
          Option::FLIPSCROLLWHEEL_VERTICAL,
        </autogen>
      </item>
      <item>
        <name>Flip Horizontal ScrollWheel at Blender</name>
        <identifier>remap.app_Blender_flipscrollwheel_horizontal</identifier>
        <only>BLENDER</only>
        <autogen>
          __FlipScrollWheel__
          Option::FLIPSCROLLWHEEL_HORIZONTAL,
        </autogen>
      </item>
      <item>
        <name>Flip Vertical ScrollWheel at Blender</name>
        <identifier>remap.app_Blender_flipscrollwheel_vertical</identifier>
        <only>BLENDER</only>
        <autogen>
          __FlipScrollWheel__
          Option::FLIPSCROLLWHEEL_VERTICAL,
        </autogen>
      </item>
    </item>
    <item>
      <name>Keys</name>
      <item>
        <name>Swap Command and Control at Blender</name>
        <identifier>private.swap_command_and_control</identifier>
        <only>BLENDER</only>
        <autogen>__KeyToKey__ KeyCode::COMMAND_L, KeyCode::CONTROL_L</autogen>
        <autogen>__KeyToKey__ KeyCode::CONTROL_L, KeyCode::COMMAND_L</autogen>
      </item>

    </item>

  </item>

</root>

with the result:

enter image description here

Related Question