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

by Michael S. Kaplan, published on 2011/11/02 07:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2011/11/02/10232468.aspx


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:

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:

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.... :-)


Van on 2 Nov 2011 10:04 AM:

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?

Michael S. Kaplan on 2 Nov 2011 10:09 AM:

Yes, the KLID is 8 hexadecimal digits.

Azarien on 8 Nov 2011 12:57 AM:

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


referenced by

2012/12/20 The Cherokee LIP on Windows 8, part 2: Let's talk about the keyboards!

2012/10/26 The evolving Story of Locale Support, part 28: We finally fixed that 'Install New Languages' thing!

2012/10/02 The evolving Story of Locale Support, part 27: No, the T and the H aren't silent...

2012/08/20 The evolving Story of Locale Support, part 26: Hey Windows 8, there's someone on the phone for you.

2012/07/11 The evolving Story of Locale Support, part 25: Something old, something new, something repurposed, and something...

2012/06/07 The evolving Story of Locale Support, part 24: I Adar you! Hell, I Double Adar you! (Windows 8 ed.)

2012/06/05 The evolving Story of Locale Support, part 23: Tamazight? Outta sight!

2012/05/17 That 'keyboard culture list' you may have heard so much about

2012/04/12 The evolving Story of Locale Support, part 22: Digit Substitution 2.0

2012/03/08 The evolving Story of Locale Support, part 21: The Windows 8 Hijripalooza extraordinaire!

2012/03/02 The evolving Story of Locale Support, part 20: Yes, it's Bangla. Not Bengali!

2012/02/21 The evolving Story of Locale Support, part 19: In honor of International Mother Language Day...

2012/02/15 The evolving Story of Locale Support, part 18: Two scripts that share ten digits can be trouble

2012/02/02 The evolving Story of Locale Support, part 17: Today I feel like translating you more than before

2012/01/24 The evolving Story of Locale Support, part 16: We can't scale to a Xishuangbanna Dai locale, but…

2012/01/17 The evolving Story of Locale Support, part 15: Fixing our listings up in Windows 8!

2011/12/22 The evolving Story of Locale Support, part 14: Tifinagh, Tamazight, and Berber? Oh my!

2011/12/21 The evolving Story of Locale Support, part 13: Divvying up locales, yet again!

2011/12/09 The evolving Story of Locale Support, part 12: Logic dictates that we keep a sense of proportion about the RATIO

2011/11/23 The evolving Story of Locale Support, part 11: What language is that keyboard for?

2011/11/22 The evolving Story of Locale Support, part 10: Perhaps it is best to think of it as unintelligent design?

2011/11/16 The evolving Story of Locale Support, part 9: Nastaleeq vs. Nastaliq? Either way, Windows 8 has got it!

2011/11/15 The evolving Story of Locale Support, part 8: [Finally] taking care of some [more] languages in Pakistan

2011/11/11 The evolving Story of Locale Support, part 7: That would be a "call and a raise" for Hawaiian

2011/11/09 The evolving Story of Locale Support, part 6: Behind the Cherokee Phonetic layout in Windows 8

2011/11/08 The evolving Story of Locale Support, part 5 (...until the decision was made to not refuse to add it)

2011/11/04 The evolving Story of Locale Support, part 4 (working beyond one's bugs, and the case for an MSKLC update)

2011/11/03 The evolving Story of Locale Support, part 3 (working beyond one's bugs, the setup)

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