0

In my application I use Low Level Global Keyboard Hook in order to detect which keys the user have pressed.

For now what my application does is translating the key to english, no matter what keyboard layout you use. What i want it to do is to be able to identify the current keyboard layout, and parse the key that was pressed to the char in the current keyboard layout.

For example, if i press 's' key on my keybard, and the current language layout is Hebrew, I want to get the char 'ד' which is the char that's written on the same key as 's' in hebrew keyboards.

Haw can I do such thing?

צח חורי
  • 371
  • 1
  • 3
  • 9
  • The following may be a different question but you will essentially need to do the same thing defined in the answer. https://stackoverflow.com/questions/4822261/is-it-possible-to-create-a-keyboard-layout-that-is-identical-to-the-keyboard-use Possibly create a mapper to map scan codes to the desired char. – RichardMc May 13 '19 at 13:25
  • The answer to the duplicate contains the information you need to get the key from the keypress by calling `MapVirtualKeyEx` and then `ToUnicodeEx`. If you want to be able to handle multi-byte characters and dead keys, there's an example in this (old) code: https://github.com/stuartd/keymapper/blob/develop/keymapper/Classes/keyboardHelper.cs#L82 – stuartd May 13 '19 at 13:28

0 Answers0