To start press the ALTGR key. Hmm… where’s the ALTGR key?

The quote in the title is an allusion to a quote from the Simpsons. Now the ANY key quote is not my favorite quote from Homer J. Simpson (actually, this is), but its in the top five.

And it popped into my head as I prepared to talk about the AltGR key, which is a key that does not exist on the keyboard upon which I am typing right now.

Anyway….

In a comment from a couple of days ago, Norman Diamond suggested that AltGr stood for Alternate Graphics. Thats fine as far as it goes, but only the first two words of his post suggest what AltGR stands for, and the words do not really explain what it means, though he talks a bit about what it does. So the question remains, where does ALTGR come from as a term?

Well, it does indeed stand for Alternate Graphics (or Alternative Grafiken). The original intended purpose of it was to have an easy way to get at the table-based graphical characters that were so handy to use in a console application, located on the right side of the spacebar.

It was, however, used quite actively for keyboards that needed extra keys (and there is no layout I know of today in Windows that supports the graphical characters except by accident in consoles, and they do not use ALTGR to get there). This does not apply to the US english keyboard hardware, so they just put a RIGHT ALT key there which will actually act as if it were the ALTGR key any time you switch to a layout that makes use of this extra shift state. Note that this extra shift state is also available by hitting <Ctrl>+<Alt>, but thats more work to type. So having a single key to type instead is much cooler.

Of course, this can cause problems since sometimes people make shortcuts using <Ctrl>+<Alt>, which screws with what people might want to actually do with a keyboard layout. In fact, Raymond Chen talked about Why Ctrl+Alt shouldn’t be used as a shortcut modifier last March, explaining this fact.

I would extend Raymond’s very good advice to anybody who uses MSKLC to create custom keyboards (note that MSKLC warns about assigning <Ctrl>+<Shift> to keyboards since many shortcuts are assigned there). Or people who uses Word to create shortcuts. Or people on the Microsoft Word team who created tons of “useful” shortcuts that do not mind stomping on what a keyboard layout may have assigned to a keystroke combination1. The key is to think about the keyboards and/or the shortcuts you create in the larger context of where you may either step on others or be stepped upon by them.

And if you create a custom keyboard with MSKLC, consider putting one of the graphical BOX DRAWING characters in the ALTGR state somewhere, so that you can be one of the cool people that makes the AltGR key meaningful again. Its like having an easter egg in software, but with an important recreational purpose!

1 – Every few months I start looking at the Word object model and its KeyBindings collection and related trivia to create a Word Add-in that will listen for keyboard changes and any time a WM_INPUTLANGCHANGE notification is received it would remove the Word shortcuts that conflicted with actual keyboard assignments. I find the undone project I was working on, get into it for a few hours, and then realize that this is something that the Word team or the Offce team ought to put together and build into the product. So I send off some mails and they agree with me and then it seems to go nowhere. A few months later it starts over again. Maybe one day one of us will have a finished solution for this problem. :-) 

 

This post brought to you by “╦” (U+2566, a.k.a. BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL).
The competition in the BOX DRAWING block of Unicode to do a topical sponsorship of the post was fierce; it was finally chosen by the drawing of lots, in order to avoid violence.
In the future, an effort will be made to woo “appropriate sponsorship” from Unicode characters based on actual relevance to the specific post. Otherwise, its like a celebrity endorsement for a product that the famous person does not use — and I hate that.

9 thoughts on “To start press the ALTGR key. Hmm… where’s the ALTGR key?”

  1. The fact is, in today’s world of proportional fonts, box drawing characters are not nearly as useful as they used to be. I am already having much trouble discouraging people from *ever* typing two spaces in a row and thus relying on the width of a space.

    On the other hand, speaking of keyboard layouts, I wonder why default Windows layouts never include such characters as ‘–’ (U+2013 EN DASH), ‘—’ (U+2014 EM DASH), ‘‘’ (U+2018 LEFT SINGLE QUOTATION MARK) and the like. Of course, when I first discovered MSKLC, I added them all to the AltGR state of my custom layout.

    This comment is sponsored by ‘…’ (U+2026, HORIZONTAL ELLIPSIS) :)

  2. Generally speaking, most keyboards focus on the characters of a language as described in either a national standard or a regional preference.

    Since neither has been needing special punctuation, it hasn’t generally been added.

  3. As far as I know, "good typography" in the English language has *always* (well, for the past couple of centuries, at least) used dashes and curly quotes, so in that sense, the English language *does* need those characters.

  4. Hey Michael, keep up the great posts. Does AltGr have anything to do with Right-Alt changing IME "sub-modes" (i.e., Roman/Hangeul mode)?

  5. Phillip N: Well, the EN and EM DASH are not… <grin> Curly quotes are one of those scary issues for non-Unicode applications since they are not on the various code pages. And there has not been a huge demand except in places like Word which actually has "Smart Quotes" rules built into it.

    Michael G: Thanks! To answer your question, not completely (they are just overloading it for important functionality), but it is a perfect overloading of the key since obviously they did not need the AltGR key for anything else. :-)

  6. Ok, now how do you make it STOP. I cannot use apostrophes or question marks because of this stupid alt gr button that I every so often accidently touch. using shift key and button for backlask and question mark, I get É, no shift é. And if I use the apostrophe button I get è and with shift to make quotes I get È.

    I keep pressed the alt gr button on its on, in combination with the alt key and shift and control. Nothing works! How do you make it stop<question mark, question mark!>

  7. Don't use a keyboard that defines the shift state; there is no other workaround….

Comments are closed.

A blog about all the things that the old Blog was about!