13

I have a good-old fashioned US keyboard. Looks like English (US).

How can I get Spanish accents on Ubuntu 12.04 ?

This article says I can use RightAlt + a but the aritcle goes only to 11.04. It also says something about dead keys, which don't seem to work.

18

You can also use the compose key.

This is a good option if you do not want to change your keyboard layout, which can bring other complications to your keybindings in various settings.

Setting the compose key in 12.04:

  1. Go to System Settings >> Keyboard Layout >> Options.
  2. Click Compose key position to expand the list of choices and select an option. A common selection is right alt.

Using the compose key:

compose key+'+a = á
compose key+-+n = ñ (that's a dash or minus)

The keys following the compose key can be in either orders, so you can also use the the following.

compose key+a+' = á
compose key+n+- = ñ

For keys requiring shift, you use shift as normal, but it is only needed once.

compose key+shift+?+? = ¿
compose key+shift+!+! = ¡

See the full Gtk compose table.

3
  • 2
    I needed this during installation. "International with altgr dead keys" appears to do the trick, making altgr the compose button. Great! Oct 8 '15 at 18:22
  • Great answer. The only letter missing I can think of in Spanish, would be: ü (achieved with compose key + u + ")
    – vabada
    Jul 14 '17 at 14:01
  • 1
    This is way too many keys to press if I'm typing a lot of Spanish or French. Here's a much better way: askubuntu.com/a/1004615/327339 Feb 9 '18 at 16:55
12

Go to System->Preferences->Keyboard and chose the layout tab. Now add a new keyboard layout: Country: USA / Variants : USA International (with dead keys). Set this layout as default.

enter image description here

You should now be able to use dead keys for accents.

1
  • I find the name "dead keys" misleading, I thought that "dead" means they don't produce a character immediately but rather wait until another key is typed which is then modified according to the previously pressed "dead" key. Nevertheless, the English (international AltGr dead keys)" behaves exactly like a US keyboard except when you hold AltGr while pressing any one of the "modifiable" keys.
    – FriendFX
    Feb 6 '14 at 11:25
4

Best answer or your money back!:

  • Updated 28 Feb. 2020 to include Ubuntu 18.04 instructions.

How to set up & use the "international with dead keys" keyboard in Ubuntu to type international characters and accents for any language, including French, Spanish, German, etc.

1. How to Install:

A. Ubuntu 14.04, 16.04 (Unity-based):

Click the Unity Search button (Ubuntu logo) and type in "Text Entry".

Click the little + button and add a new keyboard called "English (US, international with dead keys)". It will now look like this:

enter image description here

B. Ubuntu 18.04 (Gnome-based):

Go to Settings --> Region & Language --> click the "+" button under "Input Sources", as shown here: enter image description here Next, in the window that pops up --> click "English (United States)" --> "English (US, intl., with dead keys)" (as shown below) --> click "Add". enter image description here

NOW REBOOT YOUR COMPUTER! If you don't reboot now to finalize this change, the special accents and key sequences described below may not work.

2. How to Use:

Click this little button in the top right of your desktop task bar to select your keyboard now:

enter image description here OR enter image description here

OR use these keyboard shortcuts to change keyboards:

  1. Windows Key + Space bar = next source
  2. Shift + Windows Key + Space bar = previous source

(You'll see the little number in the bottom right of the image above change when you do this to indicate which keyboard is selected).

Make sure you have your new "English (US, international with dead keys)" (or in Ubuntu 18.04: "English (US, intl., with dead keys)") keyboard layout selected.

All of your accents can now be typed according to Microsoft's document here: https://support.microsoft.com/en-us/topic/how-to-use-the-united-states-international-keyboard-layout-in-windows-7-in-windows-vista-and-in-windows-xp-e05ce3ed-11f0-8fc2-498e-a214fa6b898f

Special keys to instigate accents and special characters now include the following 6 keys:

  1. ' (single quote)
  2. " (double quote)
  3. ` (back-tick)
  4. ~ (tilde)
  5. ^ (carat), and
  6. Right Alt

Here are some examples:

  1. Single quote:
    ' then e = é
    ' then i = í
    ' then o = ó
    ' then Space = '
  2. Double quote:
    " then u = ü
    " then o = ö
    " then Space = "
  3. Back-tick:
    ` then e = è
    ` then i = ì
    ` then Space = `
  4. Tilde:
    ~ then n = ñ
    ~ then Space = ~
  5. Carat:
    ^ then e = ê
    ^ then i = î
    ^ then Space = ^
  6. Right Alt (hold Right Alt while pressing the other key, rather than pressing then releasing as with the other special keys above):
    -See this site for additional characters typed this way, except when they say to use Ctrl + Alt realize you only need to use Right Alt.
    Right Alt + ! = ¡ (Spanish inverted/leading exclamation point)
    Right Alt + ? = ¿ (Spanish inverted/leading question mark)
    Right Alt + , = ç (French c-cedilla which makes a soft "s" sound)
    Right Alt + [ = « (French left quote, "guillemet gauche", left guillemet, "left-pointing double angle quotation mark", left sideways double chevrons)
    Right Alt + ] = » (French right quote, "guillemet droit", right guillemet, "right-pointing double angle quotation mark", right sideways double chevrons)
    Right Alt + z = æ
    Right Alt + w = å
    Right Alt + - = ¥
    Right Alt + s = ß (German Esszet, or "sharp s", which is identical to a German double s ["ss"])
    Right Alt + c = © (copyright symbol)
    Right Alt + r = ® (registered trademark symbol)
    Right Alt + 5 = € (Euro money symbol)
    Right Alt + 6 = ¼ (quarter fraction symbol)
    Right Alt + 7 = ½ (half fraction symbol)
    Right Alt + 8 = ¾ (three-quarters fraction symbol)

Etc etc. See the Microsoft link above (as well as this site) for full details on how to use this AMAZING new way to type accents and special characters.

Note that to type a regular single quote ' or tilde symbol, etc, you now have to either press the key once followed by Space bar OR switch back to your normal keyboard mode then press the key once. For some keys, pressing the key twice in a row also works, but for other keys, like single quote, it produces a different version of the single quote, ex: ' then ' = ´ instead of '.

References:

  1. https://linuxconfig.org/how-to-add-and-switch-keyboard-layout-on-ubuntu-18-04-bionic-beaver-linux
2
  • 1
    Best answer indeed!
    – El Marce
    Jul 18 '18 at 15:39
  • Thanks! I just added a bunch more Right Alt symbols too as I really needed the French quotes (guillemets) «» for some French writing I was just doing, and I had to figure out how to type them. Jul 8 '19 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.