En Dash with ComposeKey (Shift+AltGr)

AltGr is short for "alternative grammar". It doesn't do much on Windows, outside of adding acute accents to vowels and turning '4' into '€'.

On Linux it does a much wider variety of things and more things still with 'AltGr+Shift', just give it a try. It's not just for foreign characters but also fractions and arrows.

There is also a program called ComposeKey, which Ubuntu and probably many other distros, comes with automatically. If you type 'Shift+AltGr' the next few characters you type will be composed into  a character that sort of resembles that combination e.g. Shift+AltGr, s, s => ß and Shift+AltGr, =, > => ⇒.

You can alter the config for combinations here: /usr/share/X11/locale/en_US.UTF-8/Compose (or similar).

Although 3 hyphens does make an 'em dash', 2 hyphens doesn't make an 'en dash'. What I didn't realise until I looked in the config file was that you need 2 hyphens followed by a full-stop to create an 'en dash', which makes sense because if you wanted an 'em dash', it wouldn't know after the second hyphen whether it should turn them into a character.


  • Whether this works will likely be affected by your input method.
  • I prefer using Caps Lock as my ComposeKey


Post a comment

Popular posts from this blog

Custom Date Display in Unity Desktop (and probably some others)

Turn a Web Page into a Desktop Application

The TypeScript "extends" Keyword Doesn't Extend Types