【发布时间】:2015-04-03 04:19:28
【问题描述】:
我正在尝试使用 VkKeyScanW 函数将字符转换为相应的虚拟键代码。它适用于 ASCII 字符,但在传递 unicode 字符(中文/俄文字符)时会失败。
short vcode = VkKeyScanW(ch); //ch is of wchar_t type;
cout<<"key code:"<<vcode<<endl; //always prints -1 for unicode characters.
我在这里做错了什么?还有其他方法可以实现吗?我想将虚拟键代码传递给 SendInput 函数。
【问题讨论】:
标签: c++ windows winapi unicode sendinput