The following script used as reference, works as expected:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
Hotstring(":*:(", "(){left}")
Hotstring(":?*C:`nt", "`nT")
Output:foo{Enter}(t
foo
(t)
The second script doesn't work as expected:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
Options := "*", Triggerstring := "(", SendFun := "F1", TextInsert := "(){left}", Oflag := true, EnDis := true
Hotstring(":" . Options . ":" . Triggerstring, func(SendFun).bind(TextInsert, Oflag), EnDis)
Options := "?*C", Triggerstring := "`nt", SendFun := "F1", TextInsert := "`nT", Oflag := true, EnDis := true
Hotstring(":" . Options . ":" . Triggerstring, func(SendFun).bind(TextInsert, Oflag), EnDis)
F1(TextInsert, Oflag) ;Function _ Hotstring Output Function _ SendInput
{
if (Oflag = false)
SendInput, % TextInsert . A_EndChar
else
SendInput, % TextInsert
}
Example of use:
Output:foo{Enter}(t
It seems that first call of Hotstring do not reset triggerstring recognizer if bind method is used. What have I missed?foo
T)
Kind regards, mslonik