WinAPI:如何获取大写锁定状态? [英] WinAPI: How to get the caps lock state?

查看:245
本文介绍了WinAPI:如何获取大写锁定状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何打开或关闭Caps Lock? 我尝试搜索它,但发现的只是如何切换或打开/关闭它,这与我要查找的内容完全相反.

How can get whether Caps Lock is on or off? I tried to search it but all I'm finding is how to toggle or turn it on/off which is exactly opposite of what I'm looking for.

我正试图在C ++和Delphi中做到这一点.
请帮助

I'm trying to do that in both C++ and Delphi.
Please help

推荐答案

您想要GetKeyState()函数:

You want the GetKeyState() function:

http://msdn.microsoft.com/en -us/library/ms646301(VS.85).aspx

,带有VK_CAPITAL密钥代码.其余的虚拟按键代码在这里:

with the VK_CAPITAL key code. Rest of the virtual key codes are here:

http://technet.microsoft .com/en-us/subscriptions/index/dd375731(v = vs.85).aspx

这篇关于WinAPI:如何获取大写锁定状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆