Цитата morgan1991:
Как зделать так чтобы после нажатия левой клавиши мыши скрипт запускал определённую функцию? »
|
Простой способ:
Код:

#include <Misc.au3>
While 1
If _IsPressed("01") Then MyFunc()
Sleep(10)
WEnd
Func MyFunc()
EndFunc
Но есть способ с использованием
_MouseSetOnEvent() UDF...
Код:

#include <MouseSetOnEvent_UDF.au3>
;Disable Primary mouse button *down*, and call our function when mouse button *down* event is recieved
_MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "MousePrimaryDown_Event")
Sleep(5000)
_MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) ;Enable mouse button back.
MsgBox(64, "Attention!", "Now we disable Secondary mouse button up, and call our function when mouse button up event is recieved.", 5)
;Disable Secondary mouse button *up*, and call our function when mouse button *up* event is recieved
_MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "MouseSecondaryUp_Event")
Sleep(5000)
_MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT) ;Enable mouse button back.
Func MousePrimaryDown_Event()
ConsoleWrite("Primary Mouse Down" & @LF)
EndFunc
Func MouseSecondaryUp_Event()
ConsoleWrite("Secondar Mouse Up" & @LF)
EndFunc