Тема: AHK: Обозначение клавиши скрипта через Hotkey
С подобным вопросом уже обращался. Вроде понял саму систему назначения hotkey на клавиши скрипта. Но все же возник вопрос:
PathIni = IniFile.ini
IniRead, MyGuiHotkey, % PathIni, Section, MyGuiHotkey, % A_Space
Hotkey, % PrSetSuspend := MyGuiHotkey, !1, UseErrorLevel
Gui, Font, S16 CGray, Verdana
FileInstall, C:\Users\User\Desktop\1470403006_geroi.png, %A_temp%\1470403006_geroi.png
Gui, Add, Picture, x-38 y-10 w520 h560 , %A_temp%\1470403006_geroi.png
Gui, Add, Text, x22 y10 w210 h30 BackgroundTrans, Введите клавишу.
Gui, Add, Text, x22 y60 w100 h30 BackgroundTrans, Броня
Gui, Add, Text, x282 y60 w100 h30 BackgroundTrans, Баты
Gui, Add, Hotkey, x52 y110 w100 h30 gSetSuspend vMyGuiHotkey, %MyGuiHotkey%
Gui, Add, Hotkey, x312 y110 w100 h30 ,
Gui, Add, Text, x2 y110 w30 h30 BackgroundTrans, 1.
Gui, Add, Text, x2 y160 w30 h30 BackgroundTrans, 2
Gui, Add, Hotkey, x52 y160 w100 h30 ,
Gui, Add, Hotkey, x312 y160 w100 h30 ,
Gui, Add, Text, x2 y210 w30 h30 BackgroundTrans, 3.
Gui, Add, Text, x2 y260 w30 h30 BackgroundTrans, 4.
Gui, Add, Hotkey, x312 y210 w100 h30 ,
Gui, Add, Hotkey, x312 y260 w100 h30 ,
Gui, Add, Button, x422 y110 w40 h30 , Ок
Gui, Add, Button, x422 y160 w40 h30 , Ок
Gui, Add, Button, x422 y210 w40 h30 , Ок
Gui, Add, Button, x422 y260 w40 h30 , Ок
Gui, Add, Button, x162 y110 w40 h30 , Ок
Gui, Add, Button, x162 y160 w40 h30 , Ок
; Generated using SmartGUI Creator for SciTE
Gui, Show, w478 h438, Untitled GUI
return
GuiClose:
ExitApp
SetSuspend:
Hotkey, % PrSetSuspend, Off, UseErrorLevel
GuiControlGet, Hotkey, %A_Gui%:, %A_GuiControl%
Hotkey := FormatHotkey(Hotkey)
Hotkey, % PrSetSuspend := Hotkey,
IniWrite, % Hotkey, % PathIni, Section, % A_GuiControl
Return
return
FormatHotkey(Hotkey) {
RegExMatch(Hotkey, "S)^([\^\+!]*)(.*?)$", K)
If (StrLen(K2) = 1)
Return K1 . Format("sc{:X}", GetKeySC(K2))
Return Hotkey
}
!1::
{
Send, {sc12}
MouseMove, 418, 510
Send, {Lbutton}
MouseMove, 497, 312
Send, {Lbutton}
MouseMove, 418, 510
Send, {Lbutton}
MouseMove, 418, 535
Send, {Lbutton}
MouseMove, 497, 347
Send, {Lbutton}
MouseMove, 418, 535
Send, {Lbutton}
MouseMove, 418, 570
Send, {Lbutton}
MouseMove, 497, 382
Send, {Lbutton}
MouseMove, 418, 570
Send, {Lbutton}
MouseMove, 418, 600
Send, {Lbutton}
MouseMove, 497, 420
Send, {Lbutton}
MouseMove, 418, 600
Send, {Lbutton}
Send, {sc12}
}
return
!2::
{
Send, {sc12}
MouseMove, 468, 510
Send, {Lbutton}
MouseMove, 497, 312
Send, {Lbutton}
MouseMove, 468, 510
Send, {Lbutton}
MouseMove, 468, 535
Send, {Lbutton}
MouseMove, 497, 347
Send, {Lbutton}
MouseMove, 468, 535
Send, {Lbutton}
MouseMove, 468, 570
Send, {Lbutton}
MouseMove, 497, 382
Send, {Lbutton}
MouseMove, 468, 570
Send, {Lbutton}
MouseMove, 468, 600
Send, {Lbutton}
MouseMove, 497, 420
Send, {Lbutton}
MouseMove, 468, 600
Send, {Lbutton}
Send, {sc12}
}
returnЯ хочу обозначить "!1" что бы она менялась при смене этого hotkey:
Gui, Add, Hotkey, x52 y110 w100 h30 gSetSuspend vMyGuiHotkey, %MyGuiHotkey%Прошу помочь и если возможно объянить сам принцып.
Вот еще код самого скрипта:
!1::
{
Send, {sc12}
MouseMove, 418, 510
Send, {Lbutton}
MouseMove, 497, 312
Send, {Lbutton}
MouseMove, 418, 510
Send, {Lbutton}
MouseMove, 418, 535
Send, {Lbutton}
MouseMove, 497, 347
Send, {Lbutton}
MouseMove, 418, 535
Send, {Lbutton}
MouseMove, 418, 570
Send, {Lbutton}
MouseMove, 497, 382
Send, {Lbutton}
MouseMove, 418, 570
Send, {Lbutton}
MouseMove, 418, 600
Send, {Lbutton}
MouseMove, 497, 420
Send, {Lbutton}
MouseMove, 418, 600
Send, {Lbutton}
Send, {sc12}
}
return
!2::
{
Send, {sc12}
MouseMove, 468, 510
Send, {Lbutton}
MouseMove, 497, 312
Send, {Lbutton}
MouseMove, 468, 510
Send, {Lbutton}
MouseMove, 468, 535
Send, {Lbutton}
MouseMove, 497, 347
Send, {Lbutton}
MouseMove, 468, 535
Send, {Lbutton}
MouseMove, 468, 570
Send, {Lbutton}
MouseMove, 497, 382
Send, {Lbutton}
MouseMove, 468, 570
Send, {Lbutton}
MouseMove, 468, 600
Send, {Lbutton}
MouseMove, 497, 420
Send, {Lbutton}
MouseMove, 468, 600
Send, {Lbutton}
Send, {sc12}
}
return
