I've been to the desert on a dead key with no name

by Michael S. Kaplan, published on 2007/08/10 11:11 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2007/08/10/4322536.aspx

Reader Grieg Winter asked via the Contact link at one of those weird transitional days when the Suggestion Box was just past the 90-day mark:

Hi Mike,

I do some software input panel programming for the Pocket PC platform. Nothing commercial, just for fun. (Located on
http://www.geocities.com/grieg_winter/software/index.html in case you're interested.)

What bugs me is not actually related to programming, rather it's the label for keys, especially the modifier keys. I have't found anywhere where the localized key names are documented. So it's down to googling for photos of keyboards and trying to look if the key labels are different than those used customarily on US layout.

Ok, I'm not certain if this is actually your area. Or if this would be a topic for your future post. But if it is, consider this a reminder for "Suggest a Topic!" post (the previous one has gone past the 90-days-comments-closed period) ;)


I dug this question up since it seemed like the perfect follow-up to the post on dead keys I just did (Some of the less intuitive parts of MSKLC's user interface)....

Grieg's question is I think well covered in Getting all you can out of a keyboard layout, Part #3 -- it is easy enough to get the text of the dead key that one might put in a soft keyboard.

But I was thinking about the dead key name and wondering about it a bit. I thought I'd cover my findings here.

If we we take that post to the next step, open the dialog, and add some entries it will look something like this:

Now never mind the entries, let's focus near the top part of the dialog where you can specify the dead key name.

Now the fact that MSKLC let's you specify a name kind of implies that the name is available, right?

However, just as GDI could feel some shame over the digit substitution sup port weirdness I discussed in Digits -- there is no substitute, USER now has a chance to feel some shame too. :-(

Basically, beyond the code in Windows that loads the keyboard layout DLL information, the only bit of code that ever accesses the dead key name is in GetKeyNameText (mentioned previously in terms of both its virtues and its limitations in Report of blank previews of unknown etiology and Flirting with a strange keyboard, will you remember its language in the morning?.

Well, consider this another limitation. :-)

It boils down to the fact that the only bit of code that ever exposes or even uses the dead key name data (which exists for any dead key in any shift state) only ever runs under the following conditions:

  1. You call GetKeyNameText with the appropriate data for a specific key
  2. The base state of the key contains a dead key

In this case (and this case only!), the dead key name can be returned. This is kind of lame, and one frankly wonders why they even bothered (since for most letters they return the actual letter and only for the non-letter keys are actual "key names" returns (as I mentioned in Flirting with a strange keyboard... previously). The whole approach seems contrived and even a bit inconsistent, though technically it isn't really since it also looks for names n the other "letter" keys and simply does not find them; the only real inconsistency is how one usually has names and the other usually does not).

In this case, I think it is best to stick with the names, and maybe even override the dead key name in MSKLC with the actual character just so it can be consistent with the other letters. :-)

Perhaps I'll talk about how to get at this (otherwise entirely unavailable) information more directly another day....


This post brought to you by Ä (U+00c4, a.k.a. LATIN CAPITAL LETTER A WITH DIAERESIS)

# Szajd on 11 Aug 2007 5:31 AM:

Maybe I'm stupid, but after I read Grieg's question, I thought he meant something completely different from what you answered. Then I read it again, and again, and still believe that. So (as I said, I might be stupid, but) I think he meant how the text on a physical keyboard might differ on another keyboard in an other part of the world. Like the "End" key might have "Fin" written on it on a keyboard that was purchased in Italy. Or "Ctrl" (a "modifier key") might be... I don't know, but something different on a German keyboard.

Tell me, where am I mistaken in interpreting Grieg's letter? :)

# Michael S. Kaplan on 11 Aug 2007 6:44 AM:

Well, if that is  what he meant, then I point to the answer to that question, too. So all is good, and no one has to be stupid.... :-)

# Igor on 12 Aug 2007 7:36 PM:

I can sense a subtle reference to a certain song in this post title ;)

go to newer or older post, or back to index or month or day