How to use Windows Alt codes in Ubuntu

This question was asked many times already:

Using ALT + Keycode for accents?

Ways to enter special characters? Is Alt+Numpad possible?

How can I type ASCII characters like Alt + numpad in Windows?

But none of the answers actually solve my problem. The proposed solution, using Ctrl+Shift+U is not answer to question how to use windows Alt codes.

After many months I have finally persuaded my mum to move from Vista to Ubuntu. But the Alt codes are not working there. Teach her to use the Unicode codes is not really a viable option.

Is there a way to enable the Alt codes in Ubuntu? If not native way, maybe recompiling keyboard driver, creating some wrapper, etc…

Again I’m not asking for the Unicode solution.

Asked By: jnovacho

||

I’m very sorry to say but you want Ubuntu to be Windows, which is not going to happen tomorrow… 🙁

Ubuntu is based on Linux, and although it has “windows” than can be dragged around a “desktop” and that it adheres to the CUA like Windows, it’s just not the same thing! Asking for something and ruling out all possible answers is just going to leave you with an answer like this:

Sorry to be the harbinger of bad news, but what you’re asking for is impossible…

Answered By: Fabby

Although it’s correct that you cannot type alt key codes, there is an alternative. You can enable the ‘compose’ key to enter special characters:

How to enable compose key in Gnome

Compose key combos

Answered By: mikeyb

I found a workaround which hopefully is more universal since compose key does not exist in my very old version of ubuntu, plus my keyboard does not even have a physical compose key.

The technique is simply switching languages for your keyboard. The new language keyboard does have keys and combos for inserting special characters already built-in.

Therefore, simply:

  • Add the new language in settings: Region & Language (if you cannot find your language click on the three dots, other, more, etc and new languages should show in the list).
  • Switch between languages either from the top bar or using the default shortcuts for keyboard switching Super+Space or Shift+Super+Space (Super is the Windows Symbol Key)
  • Finally apply the key or combo for that special character.

Say you want to add Spanish accents and you have a US American keyboard then the combo should be '+vowel (obtaining á,é,…). Lastly, switch back to your language.

Answered By: Bryan Laygond