Skip to content

Instantly share code, notes, and snippets.

@alipio
Forked from tsibley/Compose-key-on-OS-X.md
Created November 6, 2019 13:19
Show Gist options
  • Save alipio/5b02089e55d276b6ae71b0ea85fe7b3c to your computer and use it in GitHub Desktop.
Save alipio/5b02089e55d276b6ae71b0ea85fe7b3c to your computer and use it in GitHub Desktop.

How to get a real Compose key on OS X

1. Install the U.S. Custom keyboard layout

Follow the installation and activation instructions for the U.S. Custom keyboard layout.

2. Install Karabiner (formerly KeyRemap4MacBook) or Karabiner Elements

If you’re using macOS Sierra (10.12), install Karabiner Elements.

If you’re using macOS El Capitan (10.11) or lower, install Karabiner.

If you’re on macOS 10.8 or earlier, you'll still use KeyRemap4MacBook, also available at the Karabiner link.

3. Configure the right Command key as your new Compose key

If you installed Karabiner Elements, add a "simple modification" mapping right_command to non_us_backslash.

If you installed Karabainer, edit and reload the private.xml file of Karabiner (formerly KeyRemap4MacBook) to contain the following:

<?xml version="1.0"?>
<root>
    <item>
      <name>Send ISO Section for right Command</name>
      <identifier>private.send_iso_section_for_right_command</identifier>
      <autogen>--KeyToKey-- KeyCode::COMMAND_R, KeyCode::UK_SECTION</autogen>
    </item>
</root>

If you already have a private.xml, you should only paste in the <item> element.

Full instructions are at: https://pqrs.org/osx/karabiner/document.html.en#privatexml

4. Enable the new “Send ISO Section for right Command” option in Karabiner/KeyRemap4MacBook

Ticky the box next to it. If you can't find it, use the search to narrow down the list. If you still can't find it, make sure you completed step 3 correctly.

5. Try it out!

Focus on any text input and try typing the following sequence to make a ♥: Right Command, <, 3

You can discover what compositions are available by using my “compose” program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment