tags:

views:

798

answers:

1

Hello.

I've implemented a low-level keyboard hook using SetWindowsHookEx() function. It works fine and returns a virtual key code for each keystroke. I can convert this virtual key code to a System.Windows.Input.Key using KeyInterop.KeyFromVirtualKey(). But the target is to get a symbol that corresponds to this virtual key code in current keyboard layout.

I.e. for German layout I want to get "Y" for Key.Z, "Z" for Key.Y.

Does anyone can help?

Thank you.

A: 

call the GetKeyboardLayout to retrieve the active layout value, then, do some conditional loop to get the result you want.

metro