by Michael S. Kaplan, published on 2004/12/22 02:04 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2004/12/22/329657.aspx

Jonathan Wilson suggested as a topic that I "Talk about the keyboard layout dlls (kbd*.dll), how they relate to MSKLC " and so I figured that might be a nice thing to spend a cycle or two on. Not just because its an interesting question, but also that people will be able to think of me as being responsive to entries in my Suggest a Topic link (assuming of course that people follow the rules in my Comment Policy link!).

Anyway, back to keyboard DLLs....

The relationship between MSKLC and these DLLs is pretty easy to describe... the former creates the latter. Well, the ones created by MSKLC are slightly cooler than the ones in the OS since they support Unicode names for the resource strings where the description and copyright are stored. Those DLLs basically contain the information that you synthesize in the user interface of MSKLC. One of those DLLs actually shows up in the i386 subdirectory of your setup package, and the reason that the name of the file you create may not be named kbd*.dll is that neither I nor anyone else at Microsoft wanted to limit you to a mere five letters to express your creative needs. :-)

The operating system files always use the 8.3 kbd*.dll naming convention, because on the whole Microsoft is unlikely to ever ship enough keyboards for that to cause a problem. Therefore, if you are using MSKLC you have the perfect opportunity to avoid overlapping existing keyboard DLLs that are shipped by Microsoft if you avoid the "kbd" prefix.

But what, in fact, are these DLLs?

Well, the full answer to that question can be a topic for another day, but.... 

For the NT-based platforms, a lot of information can be found in the Windows DDK (which also has samples), but its not in the most easy to read form. Basically, each of these DLLs created by MSKLC exports a function named KbdLayerDescriptor which returns a single big structure that has lots of data in it (the structure is defined in kbd.h). And that data is the very information that was defined in MSKLC, in an even less understandable form.

The DLLs themselves are written in C, but given how little they do in terms of code, that fact probably does not matter too much. :-)

For Windows 95, 98, and Me the format was actually very different and the DLLs were written in assembly language. But the principles are the same -- a bunch of data tables that the OS uses to figure out what the layout it.

Like I said, the full topic can be covered other days (along with some other functions that show up in a couple of these DLLs like KbdLayerMultiDescriptor, KbdLayerRealDllFile, KbdLayerRealDllFileNT4, and KbdNlsLayerDescriptor). Its definitely on my internal list of future topics, so stay tuned if you are interested....

Please note that this posting has nothing to do with IMEs whatsoever. I will deal with the myriad of issues relating to IMEs and their associated keyboards in a future posting, and all comments about IMEs may find themselves not being made public if this is fact is ignored in the comment! :-)

This post brought to you by "ચ" (U+0a9a, a.k.a. GUJARATI LETTER CA)

no comments

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2007/11/13 I know that header file is around here somewhere

2005/10/06 I will stipulate that 64-bit is the future

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