Skip to content

Commit

Permalink
Fixed a bug with new trigger mechanism: Hotstrings pairs like a and a…
Browse files Browse the repository at this point in the history
…b or add and addy rendered the second match in the pair un-triggerable. Added a search check to determine if a possible match search has already been made... this seems to fix the bug.
  • Loading branch information
adam committed Sep 27, 2007
1 parent e8ca640 commit 5a6d8f8
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions texter.ahk
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,28 +34,34 @@ FileRead, SpaceKeys, %SpaceCSV%
;Goto Start ;Goto Start
WinGet PrevWinID, ID, A WinGet PrevWinID, ID, A
SetTimer, MonitorWindows, 500 SetTimer, MonitorWindows, 500
EndKeys={Enter}{Esc} {Tab}{Right}{Left}{Up}{Down}{Del}{BS}{Home}{End}{PgUp}{PgDn}{SC77}


Loop Loop
{ {
;wait for a matching hotstring ;wait for a matching hotstring
Loop if Search <>
{ ;grab input one character at a time looking for a match {
Input, UserInput, L1 V, %EndKeys% Loop
{ ;grab input one character at a time looking for a match
Input, UserInput, L1 V, %EndKeys%
;Tooltip, Input received, 10, 10 ;Tooltip, Input received, 10, 10
if (SubStr(ErrorLevel, 1, 6) = "EndKey") if (SubStr(ErrorLevel, 1, 6) = "EndKey")
{ ;any end key resets the search for a match { ;any end key resets the search for a match
PossibleMatch= PossibleMatch=
} }
else else
{ {
PossibleMatch=%PossibleMatch%%UserInput% PossibleMatch=%PossibleMatch%%UserInput%
} }
;Tooltip, PossibleMatch= %PossibleMatch% ;Tooltip, PossibleMatch= %PossibleMatch%
IfInString, HotStrings, |%PossibleMatch%| IfInString, HotStrings, |%PossibleMatch%|
{ ;found a match - go to trigger search { ;found a match - go to trigger search
break break
} }
} ; end of inner loop
}
else
{
;msgbox, empty
} }
if PossibleMatch in %NoTrigger% if PossibleMatch in %NoTrigger%
{ ;matched in triggerless list { ;matched in triggerless list
Expand Down Expand Up @@ -119,11 +125,13 @@ Loop
PossibleMatch= PossibleMatch=
PossHexMatch= PossHexMatch=
Match= Match=
Search=0
} }
else else
{ {
PossibleMatch=%PossibleMatch%%UserInput% PossibleMatch=%PossibleMatch%%UserInput%
SendInput, %UserInput% SendInput, %UserInput%
Search=
} }
} }
return return
Expand Down Expand Up @@ -300,6 +308,7 @@ ReplaceWAV = %A_ScriptDir%\resources\replace.wav
TexterPNG = %A_ScriptDir%\resources\texter.png TexterPNG = %A_ScriptDir%\resources\texter.png
TexterICO = %A_ScriptDir%\resources\texter.ico TexterICO = %A_ScriptDir%\resources\texter.ico
StyleCSS = %A_ScriptDir%\resources\style.css StyleCSS = %A_ScriptDir%\resources\style.css
EndKeys={Enter}{Esc} {Tab}{Right}{Left}{Up}{Down}{Del}{BS}{Home}{End}{PgUp}{PgDn}{SC77}
return return


READINI: READINI:
Expand Down

0 comments on commit 5a6d8f8

Please sign in to comment.