C++和 GetAsyncKeyState() 函数
由于它只给出大写字母,所以知道如何获得小写字母吗? 如果用户同时按下 SHIFT+K 或 CAPSLOCK 等,我想得到小写。 以这种方式或其他方式可能吗?
谢谢,
As it gives only Upper case letters, any idea how to get lower case??
If the user simultaneously pessed SHIFT+K or CAPSLOCK is on,etc, I want to get lower cases..
is it possible in this way or another??
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设“c”是您放入 GetAsyncKeyState() 中的变量。
您可以使用以下方法来检测是否应该打印大写字母或小写字母。
Suppose "c" is the variable you put into GetAsyncKeyState().
You may use the following method to detect whether you should print upper case letter or lower case letter.
正如您正确指出的那样,它代表一个键,而不是大写或小写。因此,也许再次调用 ::GetASyncKeyState(VK_SHIFT) 可以帮助您确定 Shift 键是否按下,然后您将能够适当地修改后续调用的结果。
As you rightly point out, it represents a key and not upper or lower-case. Therefore, perhaps another call to ::GetASyncKeyState(VK_SHIFT) can help you to determine if the shift-key is down and then you will be able to modify the result of your subsequent call appropriately.