Search code examples
.neteventskeyboardsimulate

How to send keyboard message event with cyrillic char


i want to simulate keyboard clicks and to type certain message in Cyrillic. i know how to simulate keyboard event:

SendKeyboardMessage(handle, WM_KEYDOWN, Convert.ToInt32(key), 0);
SendKeyboardMessage(handle, WM_KEYUP, Convert.ToInt32(key), 0);

but the 3rd argument is "Keys" type and there is no Cyrillic char.

So how to send keyboard event with Cyrillic chars?

Its important to send the message to the application it self NOT global


Solution

  • Maybe try and change the keyboard layout first to Cyrillic and then simulate the keyboard events.

    I found this code project that shows how you can change the layout.

    Hope that helps