Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MapVirtualKey in different languages

9 views
Skip to first unread message

Frank

unread,
Mar 8, 2010, 8:14:05 AM3/8/10
to
Dear people,

I'm using MapVirtualKey to map virtual keys to actual
key codes. (How) is it possible to select the keyboard
layout, for example, having the function return a key code
90 ("z") for a "German" layout and 88 ("y") for an "English"
layout when the scan code is 21 in both cases?

TIA!

David Ching

unread,
Mar 8, 2010, 10:26:33 AM3/8/10
to
"Frank" <je...@gmx.de> wrote in message
news:e867bf59-2c18-4036...@z35g2000yqd.googlegroups.com...

You are starting with the virtual key and using MapVirtualKey to get its
scan code. I think when you say "key code" you really mean "scan code"? In
any cas, the "z" and "y" have different virtual key codes, that's how they
generate different scan codes.

If you want to start with 'z' or 'y' and get the virtual key or scan code
use VkKeyScan or OemKeyScan. What are you going to do with the virtual
key/scan code once you have it? I need it to use SendInput/keybd_event to
synethesize keystrokes.

-- David

Frank

unread,
Mar 9, 2010, 3:24:45 AM3/9/10
to
David Ching wrote:

> You are starting with the virtual key and using MapVirtualKey to get its
> scan code.  I think when you say "key code" you really mean "scan code"?  In
> any cas, the "z" and "y" have different virtual key codes, that's how they
> generate different scan codes.

No I'm starting with the scan code to get the virtual
key - MapVirtualKey works in both directions. By "key code"
I mean the ASCII code of the key, like 90 for "z".

But I found a solution in the meantime by sheer luck ;-)

0 new messages