Write Unicode characters with a Compose key

Caps Lock key

I think we all can agree: Caps Lock is a useless key, and should be removed from keyboard models. Until that time comes, there is still a use you can assign to the massive spacetaker above Shift. It might renew your faith in typing.

Say you are working on a document that has a lot of trademark symbols. In many cases, you could just press Ctrl+Shift+U and then type 2122, but that's too tedious and you have to type this character a lot. What do you do? You set a Compose key.

A Compose key is a key (or key combination) that you can press, followed by two characters, to produce special symbols outside of the normal ASCII range. And I sure hope you've guessed this by now: Caps Lock will be our Compose key.

In GNOME
Open System > Preferences > Keyboard, and switch to the Layouts tab, where you will find Layout Options. In Layout Options, look for Compose key position. Check the box labeled Caps Lock.

Compose Key Dialog

In KDE
These instructions are for KDE 3.5, and may or may not be similar for KDE 4. Open KControl, and go to Regional & Accessibility > Keyboard Layout. On the Xkb options tab, select Enable xkb options. Find Compose key position as in GNOME, and check the Caps Lock box.

Now it's time to have some fun. Open up a text editor and try some combinations out. Don't hold any keys down, just press Caps Lock, then the first character, then the second character. In the first example, you would press Caps Lock, then O, then C. Capitalization matters in most situations.

  • o c makes ©
  • o r makes ®
  • t m makes ™
  • . . makes … (ellipsis)
  • o o makes ° (degree)
  • c = makes €
  • L = makes ₤
  • ` a makes à
  • / o makes ø
  • t h makes þ
  • ? ? makes ¿

There are hundreds of other combinations to try out. The best way to find them is to simply type different things. If you want to know how to type a certain character, say, Æ, guess logical combinations (such as A and E).

Caps Lock image CC-BY, Tom Harpel. http://commons.wikimedia.org/wiki/Image:CAPS_LOCK.JPG

Avatar for jacob Jacob Peddicord - http://jacob.peddicord.net/

Jacob is a web developer, student, and programmer from Ohio. He is a staff member at the Ubuntu Forums and is most likely a fanboy of the distribution. He loves to write in code and words, play video games, and rant about topics most would have abandoned long ago. Jacob uses GNOME and is never seen running stable software, much to the demise of his laptop.

Home » Articles »

Discussion: Write Unicode characters with a Compose key

  1. # Posted on 12 August 2008 at 06:05 PM

    [...] Add Unicode to your keyboard Filed under: Linux — 0ddn1x @ 2008-08-12 18:05:23 +0000 http://fosswire.com/2008/08/11/unicode-compose-key/ [...]



  2. Dhraakellian (guest)

    # Posted on 13 August 2008 at 06:10 AM

    Not all of the combinations listed here actually work outside of Gnome, since it (or GTK... I don't remember which) has its own hardcoded list of compose key sequences that differs from the one that everything else uses.



  3. Jacob (guest)

    # Posted on 15 August 2008 at 01:40 AM

    Dhraakellian:

    All of them should work on any X environment if all of the necessary language packs are installed. I use it with en_US.UTF-8 and it works pretty much everywhere.



  4. Dr Small (guest)

    # Posted on 21 August 2008 at 02:11 AM

    So... How would you assign CapsLock as CTRL + SHIFT + u with xmodmap from the command line? Not everyone uses Gnome or KDE...



  5. Jacob (guest)

    # Posted on 21 August 2008 at 02:45 AM

    Dr Small:

    Again, as above, it should work on any X environment. If it is pure-CLI, well, you're stuck. Though, if you connect to it over SSH, you can assign a compose key on the client machine and it should work fine over-the-wire, as long as the full language packs are installed on the server.



  6. Dr Small (guest)

    # Posted on 27 August 2008 at 07:45 PM

    The point was Jacob, that I don't have GNOME or KDE to follow your instructions. I have X and Openbox, so the Gnome instructions are useless to me. I am not strictly in Command line.



  7. Paul B. (guest)

    # Posted on 06 November 2008 at 10:52 AM

    CAPS LOCK ISN'T USELESS :'( GIVE IT SOME LOVE MAN



  8. B. Paul (guest)

    # Posted on 03 April 2009 at 08:05 AM

    YES IT IS USELESS I TYPED THIS FOR EXAMPLE HOLDING DOWN THE SHIFT KEY. FOR EXAMPLE.



  9. Thomas (guest)

    # Posted on 29 April 2009 at 03:59 AM

    You just need to enable the compose key in your xorg.conf.

    For example:

    Section "InputDevice" Identifier "Keyboard0" Driver "kbd" Option "XkbOptions" "compose:lwin" EndSection


    This sets my compose key as my leftmost Windows logo key. (my least used key on my keyboard when running X)

    Note: If you're using VNC to connect to a remote system, it saves many headaches if both the server and the client have the same compose key setup. ¡Buena suerte!



  10. Name1 (guest)

    # Posted on 08 June 2011 at 09:35 AM

    Useless key located at the right of space key, between right control key and right alt (meta) key.



Home » Articles » Write Unicode characters with a Compose key