On windows I have always used the "ALT+3" for creating a wonderful heart for expressing my love...

Is there a way to do this on Ubuntu?


3 Answers 3


I use compose keys for all those special characters outside the English language. You can also type a heart with them.

System -> Preferences -> Keyboard Preferences

Tab "Layouts", button "Options", choose a "Compose Key Position" (I set it to Right Alt)

Now, anywhere you can type Right Alt + < followed by 3 (or your compose key of choice instead of the Right Alt of course)

btw, don't overdo the hearts...

This works intuitively for all kinds of special characters!

Right Alt + c and = gives €

Right Alt + s and s gives ß


You can find more compose key sequences here

  • 3
    I cannot stress enough how useful the composite key feature is. Being able to quickly type ♥, ☺, ß, €, ¥ etc etc happens more often than you'd think - and mapping it to a sequence is logical. On top of this, remember you can also set a third and 4th level for a keyboard - I use right-alt for the 3rd level (+shift for 4th), this gives you extended characters as well: µłðđŋħŧ←↓↑→)
    – TyrantWave
    Apr 8, 2011 at 10:26
  • My "compose key" is Shift+AltGr, which I thought was the default. AltGr is very useful on its own (for ¹²³€½¾, etc) so I wouldn't block it.
    – Oli
    Apr 11, 2011 at 13:36
  • @Oli: By using Shift+AltGr, you're overriding the shift- version of the AltGr set. AltGr+m = µ, Shift+AltGr+m = º, for example. That's why I put compose on a separate key entirely.
    – TyrantWave
    Apr 13, 2011 at 13:24
  • @TyrantWave The default compose key is Shift+AltGr -- I only meant that I think for the purpose of documenting the compose key, you should talk about the defaults. Coincidentally Compose+^+0 makes a ⁰ and it logical enough (^ = "to the power of") to be remembered, even guessed (as I just did).
    – Oli
    Apr 13, 2011 at 13:35
  • @Oli: Fair enough, I always thought it defaulted to Right Ctrl myself, I must have been mistaken. And yeah, compose works well enough to guess most patterns too.
    – TyrantWave
    Apr 13, 2011 at 14:11
  • Ctrl+Shift+U 2 6 6 5 Enter

Control-capital-u means Unicode, and the four-digit hexadecimal number for a "black heart suit" (or any other Unicode character) can be found via the Character Map in Ubuntu (gucharmap).

  • 2
    With compose keys, you can type an em-dash by using Compose Key + - followed by two -
    – steabert
    Apr 5, 2011 at 5:52
  • Having Compose is excellent, only really available out-of-the-box on a Sun Sparc Type 4/5 keyboard (which are incidentally the best layout keyboard I've ever used, and I continue to use a Happy Hacking Keyboard as a result). Unicode hexadecimal will work out-of-the-box, without the user having to reconfigure their keyboard layout first.
    – sladen
    Apr 5, 2011 at 18:46
  • 1
    I guess this only works under gnome (tested it with awesomewm in an xterm, which did not work). Jun 29, 2011 at 19:00

If you know a character's code point, you can enter the character (at least in most/all GTK apps) by pressing CTRL+SHIFT+u and then its code point number.

So to make the "♥" character, hold down CTRL and SHIFT while pressing u, then type 2665.

There are many ways to get a character's unicode code point. For example you can, look it up on wikipedia. You can do this by copy-pasting it into their search box, or using a URL like http://en.wikipedia.org/w/index.php?title=Special:Search&search=♥ They may not have entries for all characters, but I've yet to look one up that didn't have an entry providing the code point. I'm sure you could also dig up a comprehensive chart somewhere.

You can also use a programming language. For example:

$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
unicode>>> unicode('♥', 'utf-8')

or more concisely

$ python -c 'print repr(unicode("♥", "utf-8"))'

If for some reason you need to generate the character without using the CTRL-SHIFT-u trick, you can do

$ python -c 'print u"\u2665".encode("utf-8")'

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