How to add characters to the press and hold character picker in OS X Lion?
Solution 1:
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>
Solution 2:
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>
Solution 3:
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:
Disable System Integrity Protection as detailed in How to turn off rootless in Mac OS X El Capitan - MacWorld.
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.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 beKeyboard-de.plist
. It could have other names as well, depending on your keyboard language.Back this file up by pressing ⌘D. Rename the copy you made to something with "backup" in its name.
Open up the original file (without backup in its name) and edit the characters you want to in. After that, save it.
Enable System Integrity Protection as detailed in the same page as step 1.
Solution 4:
Using the info in this thread I answered the same question on MacRumors.
I made a custom .plist file specifically for Chinese Pinyin input. So I wanted to link to a plist that is created for Chinese phonetics. You can download it here.
Solution 5:
My solution (for Czech):
- Backup
/System/Library/Input Methods/PressAndHold.app/Contents/Resources/Keyboard-en.plist
file - Copy
/System/Library/Input Methods/PressAndHold.app/Contents/Resources/Keyboard-cs.plist
and rename it to/System/Library/Input Methods/PressAndHold.app/Contents/Resources/Keyboard-en.plist
- Remove useless characters from new
/System/Library/Input Methods/PressAndHold.app/Contents/Resources/Keyboard-en.plist