可不可以设置鼠标快捷键?
就是可不可以向HotKeySet函数一样,设置鼠标的某一键或组合键调用某个函数。谢谢! HotKeySet设置一个可调用某用户函数的热键.
HotKeySet ( "热键" [, "函数名"] )
UDF函数
_IsPressed
检查一个按键是否被按下
#include <Misc.au3>
_IsPressed($sHexKey [, $vDLL = 'user32.dll'])
示例/演示#include <Misc.au3>
Local $hDLL = DllOpen("user32.dll")
While 1
If _IsPressed("02", $hDLL) Then
ConsoleWrite("_IsPressed - 鼠标右键 was pressed." & @CRLF)
; 一直等待,直到按键被释放
While _IsPressed("04", $hDLL)
Sleep(250)
WEnd
ConsoleWrite("_IsPressed - Shift Key was released." & @CRLF)
ElseIf _IsPressed("01", $hDLL) Then
MsgBox(4096, "_IsPressed", "The 鼠标左键 was pressed, therefore we will close the application.")
ExitLoop
EndIf
Sleep(250)
WEnd
DllClose($hDLL)
页:
[1]