什么是键盘钩? [英] What is keyboard hook?

查看:109
本文介绍了什么是键盘钩?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读Autohotkey的文档,然后我无法理解短语键盘钩"或鼠标钩"的含义.

I was reading the Doc of Autohotkey and then I was not able to understand the meaning of the phrase 'keyboard hook' or 'mouse hook'.

这是文本:

" $前缀对于鼠标热键无效,因为它们始终使用鼠标挂钩.对于已经需要键盘挂钩的热键也无效"

URL: https://www.autohotkey.com/docs/Hotkeys.htm

推荐答案

1-一个键盘挂钩鼠标挂钩,它表示:您可以监视/接收所有键盘按键值或您监视所有鼠标按键按下值的值

1 - A Keyboard Hook or Mouse Hook that Means: that you can monitor/receive all the keyboard keypress values or that you monitor all the mouse button press values

注意:您将需要使用命令代码#InstallKeybdHook启用监视器

Note: you will need to use the command code #InstallKeybdHook to enable the monitor

对于鼠标钩,您将需要使用命令代码#InstallMouseHook

And for the Mouse Hook you will need to use the command code #InstallMouseHook

尝试此AHK代码:

Example.ahk

Example.ahk

#SingleInstance force
#InstallKeybdHook

$^c::
send ^c
send {f5}
return

esc::exitapp

2-$前缀表示您可以将热键($ ^ c::)用作相同的热键代码(发送^ c).

2 - And the $ prefix means that you can use the Hotkey ($^c::) into the same hotkey code (send ^c).

如何监视所有键盘按键值:

1-转到系统托盘.(自动热键图标)

1 - go to the System Tray.(Autohotkey Icon)

2-然后单击鼠标右键.

2 - then click right mouse button.

3-然后打开.

4-然后单击鼠标左键.

4 - then click left mouse button.

5-然后单击Ctrl + c

5 - then click Ctrl+c

6-现在您将看到 键盘挂钩 您点击了.

6 - Now you will see the Keyboard Hook that you clicked.

注意:要监视所有键盘的KeyPress值,您将需要手动按[F5]键(刷新)

Note: For Monitor All the Keyboard KeyPress Values you will need to manually press the (F5) Key (Refresh)

这篇关于什么是键盘钩?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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