What is keyboard hook?

三世轮回 提交于 2021-02-11 14:04:26

问题


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'.

this is the text:

"The $ prefix has no effect for mouse hotkeys, since they always use the mouse hook. It also has no effect for hotkeys which already require the keyboard 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

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

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

try this AHK Code:

Example.ahk

#SingleInstance force
#InstallKeybdHook

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

esc::exitapp

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

How to Monitor All your Keyboard press values:

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

2 - then click right mouse button.

3 - then go to open.

4 - then click left mouse button.

5 - then click Ctrl+c

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

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



来源:https://stackoverflow.com/questions/54171074/what-is-keyboard-hook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!