Use MacOS’s accent feature to your advantage

I often find myself scrambling for a way to insert special characters on my Mac — here’s an easier way!

Using PressAndHold to insert emoji anywhere

Quick Steps

Disable SIP Edit appropriate plist in /System/Library/InputMethods/PressAndHold.app/Contents/PlugIns/

PAH_Extension.appex/Contents/Resources/ Log out, log in Enable SIP

Tutorial

We’re going to use the PressAndHold app in MacOS to bind additional characters to unused keys. This guide applies specifically to MacOS Sierra.

Disable SIP (System Integrity Protection)

System Integrity Protection is a security feature in modern Mac operating system that prevents damaging changes to the system by revoking write access to core files. Since the file we’ll be editing is provided by a system-bundled app, we’ll need to disable SIP to change it. You can read more about SIP here: https://support.apple.com/en-us/HT204899

Here are the steps:

Reboot your Mac ( (Apple) > Restart…) Hold down command+R while rebooting to reboot into recovery mode Once in recovery mode, click Utilities in the menu bar, and select terminal

Image courtesy of MacWorld

4. Type the following to disable SIP, then reboot your Mac normally

csrutil disable

Done!

Add Custom Keys

Locate the following directory:

/System/Library/InputMethods/PressAndHold.app/Contents/PlugIns/

PAH_Extension.appex/Contents/Resources/

If you’re using Finder, you might have to right-click the app icon and select Show package contents

2. Locate the appropriate keyboard file. I’m using a standard English layout, so I’ll be editing Keyboard-en.plist

3. Make a backup of the file. If anything goes wrong, you’ll have a safe copy to revert back to.

4. Open the file using your favorite text editor, and add in the shortcuts you want. The PressAndHold popup supports Unicode, so you’re free to add accented characters, symbols, and even emoji!

You’ll need to add a key-dictionary pair as follows:

<key>Roman-Accent-q</key>

<dict>

<key>Direction</key>

<string>right</string>

<key>Keycaps</key>

<string></string>

<key>Strings</key>

<string>😂 😬 😛</string>

</dict>

Here, I’ve bound a few of my most commonly used emoji to the q key. Place your custom entries within the first <dict> tag and be careful not to use any duplicate keys.

Finishing Touches

You’re done! Log out and back in for changes to take effect! Hold down the key you’ve added and you should see the new additions. You can now use this entry method anywhere keyboard entry is permitted for fast access to your favorite symbols and characters.

It’s a good idea to reenable SIP after you’re done making changes. Follow the same procedure above, this time typing the following into terminal instead:

csrutil enable

Enjoy!