Remap Space and Command Basically, what I want to achieve is the second example here:


  As an example, we can make the space bar work as an additional ctrl key when held (similar to Space2ctrl) with the following sequence of commands.
  
  — https://github.com/alols/xcape#examples


Or here:


  This little hack for X turns the spacebar key into another control key when used in combination. When used alone, it behaves like the ordinary space bar on the key release event. Especially useful with Emacs.
  
  — https://github.com/r0adrunner/Space2Ctrl


So:


Space+x should send Command+X, 
while Space pressed and released should send one space character.
Install Karabiner.
Place this in your private.xml (~/Library/Application Support/Karabiner)

&lt;item&gt;
        &lt;name&gt;Use Space as Command modifier&lt;/name&gt;
        &lt;identifier&gt;private.space_command_key&lt;/identifier&gt;
        &lt;autogen&gt;__KeyOverlaidModifier__ KeyCode::SPACE, KeyCode::COMMAND_L, KeyCode::SPACE&lt;/autogen&gt;
&lt;/item&gt; 


It goes in between the &lt;root&gt; and &lt;/root&gt; tags.

If you want to remap it to Control instead, you can change the KeyCode::COMMAND_L to KeyCode::CONTROL_L.
Launch Karabiner, press ⟳ ReloadXML, and check the box