Need to know the VK for A, ay?

by Michael S. Kaplan, published on 2008/09/03 06:16 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2008/09/03/8921419.aspx


So the question that Tom asked was:

Hi Michael,

your blog is really amazing.
I have a question: I only have a character, like "A", and I need to find out the VK for the given keyboard layout. I have been struggeling with this topic for months without a solution. I have even made a look-up table which I feel is really weird for such a problem.

Can you help?

Kind regards

Well, the easiest place to start is with Michael's 3rd Keyboard Law for Developers, which is that Not every keyboard contains every character.

Though some might suggest VkKeyScan or VkKeyScanEx, I'll just remind people in a series of blogs such as:

to relay how I feel about those functions.

The real answer is that there isn't a real answer here except maybe doing all the work in the Getting all you can out of a keyboard layout series until and unless you find the letter you are looking for....

Should this be easier? Well, some people seem to think so. Though to be honest nothing is stored to do lookups this way, so the only way for some function to be added that makes this easy is for that function to do all the hard stuff in its implementation. And getting a new function added to Win32 really requires a compelling scenario, believe me1. But this case, I unfortunately just don't see the huge compelling scenario....


1 - I'll mention some point the new function I petitioned for in the next version of Windows and the excitement there!


This blog brought to you by A (U+0041, aka LATIN CAPITAL LETTER A)


John Cowan on 3 Sep 2008 1:09 PM:

Is this point a good point to be "some point"?


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.

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