По идее CheckWord должен вернуть состояние, которое он изменяет в своем теле, чего он не делает по всей видимости.
Какое это может быть состояние и с помощью чего можно управлять возможностью вызова хоткея из хотстринга?
; If hotkey was pressed, check wether there's a match going on and send it, otherwise send the number(s) typed
CheckWord(Key)
{
global g_ListBox_Id
global g_Match
global g_MatchStart
global g_NumKeyMethod
global g_SingleMatch
global g_Word
global prefs_ListBoxRows
global prefs_NumPresses
StringRight, Key, Key, 1 ;Grab just the number pushed, trim off the "$"
IfEqual, Key, 0
{
WordIndex := g_MatchStart + 9
} else {
WordIndex := g_MatchStart - 1 + Key
}
IfEqual, g_NumKeyMethod, Off
{
SendCompatible(Key,0)
ProcessKey(Key,"")
Return
}
IfEqual, prefs_NumPresses, 2
SuspendOn()
; If active window has different window ID from before the input, blank word
; (well, assign the number pressed to the word)
if !(ReturnWinActive())
{
SendCompatible(Key,0)
ProcessKey(Key,"")
IfEqual, prefs_NumPresses, 2
SuspendOff()
Return
}
if ReturnLineWrong() ;Make sure we are still on the same line
{
SendCompatible(Key,0)
ProcessKey(Key,"")
IfEqual, prefs_NumPresses, 2
SuspendOff()
Return
}
IfNotEqual, g_Match,
{
ifequal, g_ListBox_Id, ; only continue if match is not empty and list is showing
{
SendCompatible(Key,0)
ProcessKey(Key,"")
IfEqual, prefs_NumPresses, 2
SuspendOff()
Return
}
}
ifequal, g_Word, ; only continue if g_word is not empty
{
SendCompatible(Key,0)
ProcessKey(Key,"")
IfEqual, prefs_NumPresses, 2
SuspendOff()
Return
}
if ( ( (WordIndex + 1 - MatchStart) > prefs_ListBoxRows) || ( g_Match = "" ) || (g_SingleMatch[WordIndex] = "") ) ; only continue g_SingleMatch is not empty
{
SendCompatible(Key,0)
ProcessKey(Key,"")
IfEqual, prefs_NumPresses, 2
SuspendOff()
Return
}
IfEqual, prefs_NumPresses, 2
{
Input, KeyAgain, L1 I T0.5, 1234567890
; If there is a timeout, abort replacement, send key and return
IfEqual, ErrorLevel, Timeout
{
SendCompatible(Key,0)
ProcessKey(Key,"")
SuspendOff()
Return
}
; Make sure it's an EndKey, otherwise abort replacement, send key and return
IfNotInString, ErrorLevel, EndKey:
{
SendCompatible(Key . KeyAgain,0)
ProcessKey(Key,"")
ProcessKey(KeyAgain,"")
SuspendOff()
Return
}
; If the 2nd key is NOT the same 1st trigger key, abort replacement and send keys
IfNotInString, ErrorLevel, %Key%
{
StringTrimLeft, KeyAgain, ErrorLevel, 7
SendCompatible(Key . KeyAgain,0)
ProcessKey(Key,"")
ProcessKey(KeyAgain,"")
SuspendOff()
Return
}
; If active window has different window ID from before the input, blank word
; (well, assign the number pressed to the word)
if !(ReturnWinActive())
{
SendCompatible(Key . KeyAgain,0)
ProcessKey(Key,"")
ProcessKey(KeyAgain,"")
SuspendOff()
Return
}
if ReturnLineWrong() ;Make sure we are still on the same line
{
SendCompatible(Key . KeyAgain,0)
ProcessKey(Key,"")
ProcessKey(KeyAgain,"")
SuspendOff()
Return
}
}
SendWord(WordIndex)
IfEqual, prefs_NumPresses, 2
SuspendOff()
Return
}
Спасибо за любую наводку.