Apple - How to add characters to the press and hold character picker in OS X Lion?

The characters included in the popovers are defined in property lists inside the /System/Library/Input\ Methods/PressAndHold.app/ bundle.

I was able to change à to y by editing /System/Library/Input\ Methods/PressAndHold.app/Contents/Resources/Keyboard-en.plist and logging out and back in.

(note the escape in "Input Method" if you're copy pasting)

<key>Roman-Accent-a</key>
<dict>
    <key>Direction</key>
    <string>right</string>
    <key>Keycaps</key>
    <string>a y á â ä æ ã å ā</string>
    <key>Strings</key>
    <string>a y á â ä æ ã å ā</string>
</dict>


I know this is a little late, but I feel it's an important contribution: you can not only press-and-hold keys to input special characters; you can also input strings of text. For example, I configured my Keyboard-en.plist file so when I hold the "p" key, I can choose between my first name (which is pretty long), last name, and email address (which is also long). I feel this might be useful to some people, so this is what it looks like:

<key>Roman-Accent-p</key>
<dict>
    <key>Direction</key>
    <string>right</string>
    <key>Keycaps</key>
    <string>p firstname lastname email</string>
    <key>Strings</key>
    <string>p firstname lastname email</string>
</dict>

If you are using macOS Sierra, you need to look elsewhere to change it. Here are my instructions, inspired from Custom Characters in OS X Accent Popup - George Garside:

  1. Disable System Integrity Protection as detailed in How to turn off rootless in Mac OS X El Capitan - MacWorld.

  2. Navigate to /System/Library/Input Methods/PressAndHold.app/Contents/PlugIns/PAH_Extension.appex/Contents/Resources/ in the Finder. To go to it quickly, press ⇧⌘G and paste the string in.

  3. Find your keyboard plist file. If you are using the English layout, you would be looking at Keyboard-en.plist and if you are using the German layout it would be Keyboard-de.plist. It could have other names as well, depending on your keyboard language.

  4. Back this file up by pressing ⌘D. Rename the copy you made to something with "backup" in its name.

  5. Open up the original file (without backup in its name) and edit the characters you want to in. After that, save it.

  6. Enable System Integrity Protection as detailed in the same page as step 1.