How to make this heart (♥) using keyboard?

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 ß

EDIT:

You can find more compose key sequences here


  • 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).

  • See also: How can I type a Unicode character (for example, em-dash —?)

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')
u'\u2665'

or more concisely

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

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")'
♥