拦截大写锁定按下的最佳方法
为了制作像 Launchy 这样的程序,拦截 Windows 上的 Caps Lock 按钮的最佳方法是什么?
目前,我正在使用 SetWindowsHookEx 设置低级挂钩,但是这对我来说有点太低级了,因为我不想拦截其他试图在低级活动的程序。我正在寻找尽可能最高级别的拦截,但仍可以防止打开大写锁定本身...有更好的建议吗?
What is the best way to intercept the Caps Lock button on Windows, for making a program like Launchy?
Currently, I'm setting a low-level hook with SetWindowsHookEx, but that's a bit too low-level for me, since I don't want to intercept other programs that are trying to be active a low level. I'm looking for the highest possible level of interception that can still prevent turning on Caps Lock itself... any better suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
RegisterHotKey
:只要按下此键,您的窗口就会收到
WM_HOTKEY
消息。You can use
RegisterHotKey
:Your window will receive a
WM_HOTKEY
message whenever this key is pressed.显然,最好的方法是使用低级挂钩,因为 RegisterHotkey 不会拦截密钥。
Apparently the best way is to use a low-level hook, since
RegisterHotkey
doesn't intercept the key.