114

Currently I use the character palette applet in gnome panel to put special characters into text.

This is okay, but I have to stop typing, select the character I want from the applet and then copy and paste.

Is there a way to simply type special characters with different key combinations? If so, how do I do it?

wjandrea
  • 14,236
  • 4
  • 48
  • 98
Helix
  • 2,363

9 Answers9

118

Often this is easier with the compose key. With that configured you use key combos to get the special characters. For instance:

  • For ë you press Compose, ", e.
  • For you press Compose, ~, e.
  • For ô you press Compose, ^, o.
  • For á you press Compose, ', a.
  • For à you press Compose, `, a.
  • For you press Compose, =, e.
  • For £ you press Compose, -, l.

Note that you do not have to hold down the compose key; just press each key in order.

To set the compose key go to System -> Preferences -> Keyboard, then Layouts -> Options. Open up Compose Key Position and choose a key. I use Right-Alt.

  • 21
    Spot on, except for one thing - you don't need to hold down the compose key at all. Just hit the compose key, `, then a, and voilà! – Jeremy Kerr Jul 29 '10 at 13:16
  • Yep. You're right. Habit made me think that it was actually required. – Dave Jennings Jul 29 '10 at 13:18
  • +1 for allowing me to get rid of the special characters panel applet – jfoucher Aug 01 '10 at 09:36
  • 7
    I recommend assigning the Compose key to Caps Lock, which I am pretty sure only comes standard on keyboards to annoy people. – tyjkenn Aug 16 '12 at 01:15
  • @tyjkenn Actually Caps Lock can be useful on other keyboard layouts. For instance, in the French layout, 2 shares its position with "é". Caps Lock will print "É" instead of "é" on Linux (on Windows, you get "2"). – rds Sep 19 '13 at 20:06
  • @DaveJennings : Where can I get list of ", ~, ^, etc with their use in compose key? – Pandya May 14 '14 at 11:33
  • 3
    á <-- it worked! – Dave Jun 26 '15 at 04:09
  • 2
    @Pandya, perhaps https://help.ubuntu.com/community/GtkComposeTable is the answer for the list of available "compositions" – Piotr Findeisen Feb 01 '16 at 03:33
  • 4
    At least for Ubuntu 16.04 the described path doesn't work. Neither is there a preferences section in System (it's called System Settings), nor is there a Layout section in Keyboards (it's called Keyboard, without s). – MERose Jan 10 '18 at 19:59
  • @MERose, I use Ubuntu Mate these days, and it does still have that path in 16.04, but perhaps mainline Ubuntu no longer does – Dave Jennings Jan 31 '18 at 23:02
  • This worked in KDE5 as well. – virtualxtc Jan 21 '19 at 19:17
  • 1
    This doesn't work for Ubuntu 19.10. See @léo-léopold-hertz comment under the question for a gsettings solution that works. – tudor -Reinstate Monica- Jan 08 '20 at 08:23
  • 4
    This is the answer for distros from 10 years ago (which reflects the documentation, ironically). Neither one works for 20.04. The question needs to be tagged as ubuntu-10 or something. – Chaim Eliyah Sep 21 '20 at 17:57
  • For whatever reason, this doesn't work on my system. The compose+key press produces a character immidiately. So to get é I would press compose+¨ then e. But then I get ´e. – birgersp Jul 06 '22 at 06:30
39

If you know the unicode value of the character you'd like to type, hit CTRL+SHIFT+u and then type the unicode.

Example:

CTRL+SHIFT+u 0 3 b b ENTER

results in λ.

  • 1
    I seriously didn't know this was possible. Many thanks. For anyone wondering where to find the unicode umm... codes, http://www.unicode.org/charts/index.html is the place to go. – taneli Jul 25 '12 at 20:02
  • 9
    Seriously, only people on Windows do that. – rds Sep 19 '13 at 20:01
  • do you know how to do this in wps office? – Marcel Oct 19 '15 at 21:29
  • @taneli also you can use other way. click the Keyboard Layout Icon on the top bar, then click the Character Map link in the dropdown menu. –  Mar 20 '16 at 13:58
  • @rds I disagree. I've been a Linux user since 1994 and taught many other users the hex method since my 80's DOS days. From around 2008, I started to teach them how to use US-Intl-AltGR + Compose instead. So maybe you mean to say "few new users rely on the hex code method". – Wil May 30 '22 at 17:05
  • It doesn't work for me. I press CTRL-SHIFT+U and nothing happens, then i start typing the code and it just writes those digits into the text editor and when i press enter it just make a new line. It this only for the English keyboard/locale? – Youda008 Jun 24 '23 at 16:27
16

Here is an answer close to 1st answer, with a little alternative: I do not need to use compose because I set my keyboard to English US international instead of English US or English UK.

So I use the following combo:
" then e for ë
' then e for é
` then e for è
` then a for à
~ then n for ñ

and
" then spaceBar for "
' then spaceBar for '
` then spaceBar for `
~ then spaceBar for ~
Alt Gr plus 5 for

Boris
  • 4,932
  • Is this still the case in Ubuntu 15.10? I don't get this working anymore. Setting either 'English (US, international, with dead keys)' or 'English (international, dead keys via AltGr)' doesn't work. – Lode Jan 28 '16 at 21:10
  • 1
    I've found that setting the 'English (US, international, with dead keys)' actually works if set via lxkeymap (sudo apt-get install lxkeymap). Even more interesting, it only needs to be set once, as if some extra config is changed to make it work. (Dutch source: https://sites.google.com/site/computertip/toetsenbord) – Lode Jan 28 '16 at 21:28
  • @Lode sorry I ve not install 15.10 yet. – Boris Mar 24 '16 at 19:23
  • This is imho the actual answer, at least for all (Dutch) users coming from Windows. – Rich_Rich Dec 30 '22 at 11:29
  • 1
    As a programmer, dead keys are a deal breaker. I use the ~, ', ", ` a lot in programs and having to hit two keys would be terrible. Using the Compose key is much easier for me. I don't do much typing with diacritics, luckily. – Alexis Wilke Jan 29 '23 at 17:04
  • There's no such keyboard included with Gnome. – Cerin Feb 16 '24 at 22:25
12

The easiest way I've found to do this is to set your keyboard layout to USA International (AltGr dead keys), then use Right-Alt+whatever to get the character you want. Obviously this does not work for all international/special characters, so if you need one that's not available through this method, use one of the other methods listed here.

Wikipedia gives us a handy diagram of the available characters and the keys they are mapped to.

DLH
  • 2,445
  • It's also relatively easy to edit a keyboard layout file and tailor it to one's needs: — – «» “” … – ΤΖΩΤΖΙΟΥ Sep 04 '10 at 00:32
  • 1
    Most local keyboard layouts (e.g. Belgian, French, etc.) also support AltGr, but the selection and location of special characters will be different. The exact layout can be seen on a similar diagram from inside the keyboard configuration. – JanC Jun 09 '11 at 13:23
  • 2
    Using English (international AltGr dead keys) as keyboard layout, use Right-Alt + R to get ë/Ë. Right-Alt + Q = ä/Ä; Right-Alt + P = ö/Ö; Right-Alt + Y = ü/Ü; Right-Alt + S = ß – c0xc Apr 26 '17 at 15:13
  • Alt-Gr + dead key is available from scratch. It saved my life when selecting a Wi-Fi hotspot with a special character in the name, as I was performing a fresh Ubuntu install. – Laurent Caillette Jul 08 '18 at 17:02
  • Thanks, but many accented characters are missing in the default keyboard chart, like there is ç but no ş and no š either - but fractional numbers like ¾ and a thorn character. Looks like a leftover from some 8-bit MS-DOS page or some other US-American notion of "international". – Ingo Steinke Jan 03 '24 at 14:30
6

Note for dummies like myself. It took me a while...

  1. Press Cont & Shift & u together
  2. Let go of all three keys
  3. input code (for example: 00e1 for á)
  4. Enter
Jjack
  • 61
5

If you are on Ubuntu 20.04 :

Go to Setting > Region and language > on the Input Sources Click on "+" button and choose English (United States) then English(US,intl.,with dead keys).

' + e -> é
" + e -> ë
` + e -> è
etc.

  • 1
    The exact same answer was already posted here by user Boris, and with a better explanation, yet it seems like this is a good extra step since later versions do not fully support their method (as commented). – Pizza Apr 09 '21 at 07:29
  • It's not the same answer. Oussama provided the only solution that works for the latest releases of Ubuntu. Thanks! – prismspecs Mar 11 '22 at 11:56
  • I'm on Ubuntu 22 and that keyboard option no longer exists. – Cerin Feb 16 '24 at 22:26
2

You can use Ctrl + U and type Unicode number of the sign you want to type. So for ē you have to type Ctrl + U + 113.

qbi
  • 19,125
1

The compose key it's defined to do key combinations. It's Used to produce special characters like tildes and accents. To see the list of key names open /usr/share/X11/xkb/rules/xorg.lst and search for "compose".

This technique was tested in Lubuntu. Two ways to enter special characters:

  1. Call setxkbmap to define compose key in the current session
  2. Define compose key permanently

1). Command line $ setxkbmap -option "compose:rwin". Example to define compose key right 'Win'.

2). Open file /etc/default/keyboard and add line XKBOPTIONS="compose:rwin" (requires restart).

Example to write character ã after defining compose key. Press the compose key, then key 'a' and finally the tilde (AltGr + 4).

https://www.eovao.com/en/a/special%20characters%20ubuntu%20linux/5/how-to-enter-special-characters,-accents-and-tildes-in-ubuntu

oat
  • 11
1

Change your keyboard layout to us. intl with dead keys

Go to

Control center > keyboard > layout > add > set country to us > Select us intl. with dead keys.

shylynx
  • 2,411