The evolving Story of Locale Support, part 2 (raising the roof on keyboards)

Sorting it all Out
Michael Kaplan's random stuff of dubious value
Be sure to read the disclaimer here first!

The evolving Story of Locale Support, part 2 (raising the roof on keyboards)

  • Comments 31

Previous blogs from this series:

Some of the most ground-breaking work in the area of locales has (ironically) been in other areas entirely.

I won't go so far as to call it innovative, but some of it involves clever thinking outside the box to get around long-standing architectural limitations in the platform.

The limitation I refer to is the fact that every keyboard we have ever shipped is associated with some locale -- with some LCID.

The LCID, or to be more precise, the LANGID portion of the LCID, is embedded in both the KLID value that defines the keyboard layout itself and the HKL that acts as a handle to an installed layout that's in use.

So the attempt to be creative kind of started with MSKLC 1.4, which added support for the creation of keyboards attached t custom locales (as described in Getting the language of an LCID-less keyboard and Getting the language (and more!) of an LCID-less keyboard).

One of the important design decisions we made in order to support a keyboard based on a custom language:

  • At keyboard layout authoring time, the author must have a custom culture or custom locale installed covering the language;
  • At keyboard layout install time on the target machine, no custom culture or custom locale needs to be installed.

The first point makes it easier to provide UI that limits the ability to support the custom language to the existing architecture without making major changes:

This sets the bar a little high, but keeps from requiring some crazy mechanism to add custom names at a time when MSKLC 1.4 was given limited resources.

However, requiring the custom culture/locale to be on the target machine would have been unreasonable, and not needed.

I mean all we needed was a way to get the name in.

So the mechanism to add a name was added, with a special KLID value of A00#0c00.

Years later, Peter Constable and Andrew Glass were dealing with an entirely different problem.

They have long been suffering through the support of languages and scripts support in typography for which no keyboard supported existed.

Claiming to support "Language X" in a new font for a new version while providing no way to type Language X feels like a bad answer to the problem.

So after a meeting with Andrew, the plan was formed: take the custom language solution in MSKLC 1.4 that supports custom LCID-less languages and use it to solve the LCID-less languages and scripts we ship in Windows 8!

A quick check in the registry of a Windows 8 machine (you can see it yourself in the Developer Preview, with the only difference between what you would see and this screenshot being that mine is pseudo mirrored):

With the telltale 000#0c00 KLIDs, they are pretty easy to spot. And by this method, all of the following languages have keyboards have been added to Windows 8 despite having no specific locale being added for them:

  • New Tai Lue
  • Tai Le
  • Tifinagh
  • Myanmar
  • Ogham
  • Phags-Pa
  • Lisu
  • N'Ko

All of them are supported in fonts (in several cases even in existing versions), and now (as of Windows 8) you can type them with built-in keyboards!

Of course there are some interesting tangentially related problems that came up along the way, but those can be subjects for other blogs, on other days.

For now, the fact that a new shipping keyboard in Windows doesn't always mean a new locale is cool enough that I think it can stand on its own merits.... :-)

Comment on the blather
Leave a Comment
  • Please add 2 and 7 and type the answer here:
  • Post
Blog - Comment List
  • Forgive the possibly rookie question, but does the KLID numbering imply a limit of 16 (# = 0-9, A-F) custom-language keyboards on a given computer, or can these be non-unique?

  • Yes, the KLID is 8 hexadecimal digits.

  • Previous blogs from this series:

    part 0 (The introduction)

    part 1 (Some people don't want to

  • Previous blogs from this series:

    part 0 (The introduction)

    part 1 (Some people don't want to

  • I see some disturbance in the "[(value not set)]" and "[(Default)]" strings. The additional characters are switched when compared to all other strings.

  • Previous blogs from this series:

    part 0 (The introduction)

    part 1 (Some people don't want to

  • Previous blogs from this series:

    part 5 (...until the decision was made to not refuse to add

  • Previous blogs from this series:

    part 6 (Behind the Cherokee Phonetic layout in Windows 8)

    part

  • Previous blogs from this series:

    part 7: That would be a "call and a raise" for Hawaiian

    part

  • Previous blogs from this series:

    part 8: [Finally] taking care of some [more] languages in Pakistan

  • Previous blogs from this series:

    part 9: Nastaleeq vs. Nastaliq? Either way, Windows 8 has got

  • Previous blogs from this series:

    part 10: Perhaps it is best to think of it as unintelligent design

  • Previous blogs from this series:

    part 11: What language is that keyboard for?

    part 10: Perhaps

  • Previous blogs from this series:

    part 12: Logic dictates that we keep a sense of proportion about

  • Previous blogs from this series:

    part 13 (Divvying up locales, yet again!)

    part 12 (Logic dictates

Page 1 of 3 (31 items) 123