I know that header file is around here somewhere

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

I know that header file is around here somewhere

  • Comments 5

Over in the microsoft.public.win32.programmer.international newsgroup, JohnD asked:

Hello all,

I have an interest in calling KbdLayerDescriptor.

Michaels blog here:

http://blogs.msdn.com/michkap/archive/2004/12/22/329657.aspx

reports that the return of KbdLayerDescriptor is defined in "kdb.h".

I've downloaded the "Windows Driver Kit for Windows Vista", but I cannot find kbd.h or anything relevant in there.

Where can I get kbd.h? Is it part of one of the other Microsoft SDKs/DDKs?

Thanks in advance.

/john

If JohnD had asked in the blog's Suggestion Box or as a reply to that post (%WINDIR%\system32\kbd*.dll) I probably would have seen the question sooner!:-)

Anyway, I have had several of the various DDK/WDK packages installed plus being enlisted in various source code projects at Microsoft, so here are three reliable places to find the file:

  • If you are internal to Microsoft and work in a source code project that picks up the NT Publics, it can be found at oak\inc\kbd.h.
  • If you have MSKLC 1.3 or 1.4 installed, it can be found in the MSKLC installation directory, at inc\kbd.h.
  • If you install the Windows Driver Kit, it can be found in the WDK install directory, under inc\api\kbd.h (sample projects using it can be found in the WDK install directory under src\input\layout).

There are other DDK/WDK type installations that also have it, so in all likelihood if you have one installed some casual spelunking through inc directories might be worth a look.

John had a follow-up question a few days later after he found the file (on his own, via the third bullet point above):

Am I correct in assuming that typedef KbdLayerDescriptor returns a struct tagKbdLayer?

This is a great time to look at those samples I mention above -- with the exception of conceptual topics, code is always the best documentation, dontcha think? :-)

I must admit that I am always curious about what people are trying to do when they want to call a keyboard layout DLL directly. It has come up probably about 15 times over the last five years, in all but one case it was not really what was needed....

 

This post brought to you by(U+18a4, a.k.a. MONGOLIAN LETTER MANCHU ALI GALI ZHA - a letter that is not on the Vista keyboard for Mongolian, for hopefully obvious reasons?)

Comment on the blather
Leave a Comment
  • Please add 7 and 3 and type the answer here:
  • Post
Blog - Comment List
  • Hello Michael,

    Thanks for that, it looks very promising.  The reason I want this is that I want to be able to display in my GUI the keystroke combinations needed to generate a particular character. I'm hoping that  KbdLayerDescriptor will allow me to do that.

    Thanks, Again,

    John

  • Actually, you can also use the supported USER32 functionality to do this -- you can look at the series I did at http://blogs.msdn.com/581107.aspx for more info (that is the last post in the series, it has links to all the previous ones).

  • OK, I give up... why isn't U+18A4 not on the keyboard, and why is the reason obvious?

  • For the same reason that the English keyboards are missing some letters used for Hungarian -- because that letter is used for Manchu and Ali Gali. :-)

  • Michael,

    You are, of course, correct. VkKeyScan gives me the information I need.     I'd tried VkKeyScan earlier, on a non-"Microsoft Keyboard Layout Creator" keyboard and it had not worked, so I had discounted it. In hindsight I should have realized that VkKeyScan would have to call KbdLayerDescriptor to get the job done.

    Thanks for pointing me in the right direction.

    /john

Page 1 of 1 (5 items)