I know that header file is around here somewhere

by Michael S. Kaplan, published on 2007/11/13 10:16 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2007/11/13/6122573.aspx


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:

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?)


# John Daintree on 14 Nov 2007 11:38 AM:

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

# Michael S. Kaplan on 14 Nov 2007 11:59 AM:

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

# Gene on 14 Nov 2007 3:14 PM:

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

# Michael S. Kaplan on 14 Nov 2007 4:01 PM:

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

# John Daintree on 15 Nov 2007 5:45 AM:

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


referenced by

2011/03/24 Knowing the layout doesn't mean knowing how to lay it out....

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