WinAPI:如何获得大写锁定状态? [英] WinAPI: How to get the caps lock state?
本文介绍了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屋!
查看全文