For MacOS Ukulele is a decent option. If you are more geeky there is a plist (XML file) you can edit to add the Esperanto press-and-hold characters alongside all the ones you currently have. Unfortunately, editing that file requires temporarily disabling system integrity protection and thus four restarts (one to turn it off, one to get back into your account and edit it, one to turn it back on, one to get back into your account).
The location of the file sometimes changes with OS updates, but in High Sierra, and Catalina it is located at
/System/Library/Input\ Methods/PressAndHold.app/Contents/PlugIns/PAH_Extension.appex/Contents/Resources/Keyboard-en.plist
To add the Ŭ
character, for example, you would edit the Roman-Accent-U
section to have the additional Ŭ
as shown below.
<key>Roman-Accent-U</key>
<dict>
<key>Direction</key>
<string>left</string>
<key>Keycaps</key>
<string>U Û Ü Ù Ú Ū Ŭ</string>
<key>Strings</key>
<string>U Û Ü Ù Ú Ū Ŭ</string>
</dict>
You would add that character via the "Show Emoji And Symbols" menu item you can have displayed under the list of keyboards in the menu bar, which is enabled via the keyboards system preference.
Full step by step instructions can be found here .