MacOS – What are the key-names for the PressAndHold.app keyboard plists

internationalizationmacos

To avoid ambiguity in this question I will use key to mean a plist-dictionary-key (look-up string); and key to mean a button on your keyboard.


This answer to another question identified a great way to edit the special characters you can insert using the press-and-hold method on your keyboard.

You can edit the Keyboard-xx.plist files of the PressAndHold.app to add your characters to existing press-and-hold keys. The plist dictionary keys for each press-and-holdable key look like this: <key>Roman-Accent-a</key>, and <key>Roman-Accent-A</key>, etc. but if you want to add some press-and hold characters to a number key, or a punctuation key then you need to know the key name for the dictionary in order to add it.

I want to add press-and-hold characters for the 2 and 3 keys and possibly others, I have tried the following formats for the key names in the plist file:

2
Number-2
Roman-Accent-2

None of these add a press-and-hold popover for the 2 key. What are the correct key names for all of my keyboard keys that I can add in Keyboard-en.plist?

Best Answer

I have actually the same question, but this may help someone that is trying to figure this out.

I found here, that the name is probably Roman-Accent-2: https://github.com/skalnik/dotfiles/blob/master/osx/emoji-expansions.plist

as this code is used:

<key>Roman-Accent-1</key>
<dict>
<key>Direction</key>
<string>right</string>
<key>Keycaps</key>
<string>1? 1?</string>
<key>Strings</key>
<string>1? 1?</string>
</dict>

Also look up Keyboard-ja.plist, and you see that they use this Roman-Accent-x for almost any character x. But nevertheless, it doesn't work for me if I add it to Keyboard-en.plist. I don't understand why.