I'm looking to use a hotkey to type specific Spanish letters, like LeftAlt+~+n outputting ñ. However, I don't want to use the dead keys thing, and the compose key doesn't give me the ñ character as far as I can tell. I know how to make hotkeys, just not the command to type. (Much less type characters that aren't on my keyboard or keyboard layout.)
You can type this character in using: Ctrl+Shift+ U then type
00f1
and press enter.Also we can use
xdotool
to bind a key for this character, ifxdotool
is not installed first install it (around 60kb) using:Go into keyboard settings, add a custom keyboard shortcut with this content:
The best result I got was binding a Fx key.
If you have a US or UK keyboard (and possibly others but I don't know) you can go to System Settings -> Text Entry, and add a keyboard with “international with AltGr dead keys” or “alternative international” in the name (which name it lists depends on the Ubuntu version as far as I can tell). With this your right Alt gives you áéíóúüñ¿¡ and even ç (and a bunch more useful ones), and a number of dead keys. As long as you don't press that key it's your regular US (or UK) keyboard; press that key and it changes mode. I mostly write in English but I often write in Spanish and this is the only layout that is unobtrusive enough that I don't need to release muscle memory, while still being quick and obvious to use.