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.
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.
So:
- Space+x should send Command+X,
- while Space pressed and released should send one space character.
Best Answer
Install Karabiner.
Place this in your private.xml (
~/Library/Application Support/Karabiner
)It goes in between the
<root>
and</root>
tags.If you want to remap it to Control instead, you can change the
KeyCode::COMMAND_L
toKeyCode::CONTROL_L
.Launch Karabiner, press ⟳ ReloadXML, and check the box