I prefer a qwerty keyboard for programming, but to write in my native language (Dutch) I need sometimes accented characters like ë, ï, é, etc, which do not have dedicated keys on a qwerty layout.

A handy way under Linux is to use a "compose key" ([Alt Gr] on my setup), which allows you to compose accented characters by entering the accent (umlaut, accent grave, ...) and the unaccented character separately.

Some examples (I don't use all these cases myself, it's just an illustration of what is possible):

  • for "é", I type [Alt Gr] ['] [e]
  • for "è", I type [Alt Gr] [] [e]
  • for "ü", I type [Alt Gr] ["] [u]
  • for "ô", I type [Alt Gr] [^] [o]
  • for "ç", I type [Alt Gr] [,] [c]
  • for "ñ", I type [Alt Gr] [~] [n]
  • for "å", I type [Alt Gr] [o] [a]
  • for "æ", I type [Alt Gr] [a] [e]
  • for "Œ", I type [Alt Gr] [O] [E]
  • for "ø", I type [Alt Gr] [/] [o]
  • for "ß", I type [Alt Gr] [s] [s]

To enable this feature under Ubuntu Linux 8.04 (Gnome desktop) go to the keyboard preferences (Ubuntu menu > "Settings" > "Preferences" > "Keyboard").

Keyboard settings in Ubuntu menu

Then, go to the tab "Layouts" and press the "Layout Options..." key at the bottom. Under "Compose key position" you can enable the compose key of your liking (which is [Alt Gr] aka "Right Alt" for me).

Compose key settings

This is for Ubuntu 8.04, but other flavors of Linux or other window managers probably have very similar ways to configure the compose key.