mode:=1 ~MButton:: if (WinActive("ahk_class CabinetWClass") != 0 && mode=1) { if (A_PriorHotkey <> "~MButton" || A_TimeSincePriorHotkey > 500) ; если одинарное нажатие СКМ { KeyWait, MButton ; --------------------------------------------------------------------------- Send {F5} ; --------------------------------------------------------------------------- return } if (ErrorLevel=0) ; если двойное нажатие СКМ { mode:=2 SoundPlay, mode.wav ;MsgBox, Переход в режим 2 return } } ~LButton:: if (WinActive("ahk_class CabinetWClass") != 0 && mode=2) { if (A_PriorHotkey <> "~MButton" || A_TimeSincePriorHotkey > 500) ; если одинарное нажатие СКМ { KeyWait, MButton ; --------------------------------------------------------------------------- if (GetKeyState("LButton", "P") != 0) ; если ЛКМ была нажата { loop { if (GetKeyState("LButton", "P") = 0) ; если ЛКМ уже не нажата (отпущена) { ;MsgBox, ЛКМ отпущена Send {F5} break } } } ; --------------------------------------------------------------------------- return } if (ErrorLevel=0) ; если двойное нажатие СКМ { mode:=1 SoundPlay, mode.wav ;MsgBox, Переход в режим 1 return } } return |