Код
Gui, Add, Hotkey, w50 vHot1 gCorrectHK, % Hot1
Gui, Add, Hotkey, w50 vHot2 gCorrectHK, % Hot2
......
Gui, Add, Hotkey, w50 vHot14 gCorrectHK, % Hot14
......
CorrectHK:
Gui, Submit, NoHide
If %A_GuiControl% in +,^,!,+^,+!,^!,+^! ;If the hotkey contains only modifiers, then return to wait for a key.
return
If (%A_GuiControl% = "")
return
num := SubStr(A_GuiControl,1)
TempNewHK := % %A_GuiControl%
HKTemp := % A_GuiControl
loop, 14
{
TempHK := % Hot%A_Index%
if not (num = "Hot"A_Index)
if (TempHK = TempNewHK)
{ TrayTip, Ошибка
,% "Данное сочетание " TempNewHK " клавиш уже занято`n", 5
GuiControl,Text ,%A_GuiControl%, ""
}
}
return