Friday, March 25, 2022

How to add / edit characters in the "Press and hold" character picker in OS X Monterey

I'd like to add some additional characters to the "Press and hold" popup that shows up if I long press a a letter on the keyboard. I also need to change the position of some of the additional characters. The keyboard layout that I use is English, so I'll modify the press&hold options for this layout.

What I have for "s" now:

What I need:
 


Step 1. Copy the PressAndHold.app from the system folder into the user folder

(Since OS X Monterey won't let you easily modify any file that is under the system folder).

Open Finder
Press "shift + command + G"
Enter "
/System/Library/Input Methods"
Find and copy the "PressAndHold.app"

Press "shift + command + G"
Enter "/Library/Input Methods"
Paste the "PressAndHold.app"

Step 2. Open and edit the file with additional characters in your user folder

Open Finder
Press "shift + command + G"
Enter "Library/Input Methods/PressAndHold.app/Contents/PlugIns/PAH_Extension.appex/Contents/Resources"

Locate the file "Keyboard-en.plist"
Make a backup of the file just in case (there is always a read-only version under the system folder anyway, though)
Edit the file to your liking (change the order of additional characters, add a new character or whole new section for a key, etc.)
Save the changes

Step 3. Log out and log back in for the changes to take effect

The updated PressAndHold character picker should now work per your changes.

Note. Most probably this would only work for your user, but not other users on the same machine. But updating the PressAndHold menu in the System folder would require too much hassle with permissions, write access to the driver, etc.