When using KEYEVENTF_UNICODE
, the kb.wScan just has to be the wchar_t
unicode character.
Don't use MapVirtualKey
.
Also, don't forget to send the "Key Up" transition, just after the Key Down.
UINT res = SendInput ( 1 , & kInput , sizeof ( INPUT ) ) ;
kb.dwFlags |= KEYEVENTF_KEYUP;
res = SendInput ( 1 , & kInput , sizeof ( INPUT ) ) ;