Spanish accents on US keyboard

Solution 1:

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.

Solution 2:

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.