Skip to content
This repository was archived by the owner on Sep 5, 2018. It is now read-only.

Commit 53d56b4

Browse files
committed
fix bug where case-sensitive hotstring wasn't being passed to label
mentioned in issue #5 the following example was previously failing, but is fixed with this commit: Hotstring("Trigger2", "replace", 2) replace($) { ; $ == 'trigger' MsgBox % "'" . $ . "' was entered!" }
1 parent 6bdf7b5 commit 53d56b4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Hotstring.ahk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Hotstring(trigger, label, mode := 1, clearTrigger := 1, cond := ""){
107107
A_LoopCond := Func(v.cond)
108108
if (A_LoopCond.MinParams >= 1){
109109
; If the function has atleast 1 parameters.
110-
A_LoopRetVal := A_LoopCond.(v.mode == 3 ? local$ : local$.Value(0))
110+
A_LoopRetVal := A_LoopCond.(v.mode == 1 ? local$.Value(0) : local$)
111111
} else {
112112
A_LoopRetVal := A_LoopCond.()
113113
}
@@ -122,12 +122,12 @@ Hotstring(trigger, label, mode := 1, clearTrigger := 1, cond := ""){
122122
SendInput % "{BS " . StrLen(local$.Value(0)) . "}"
123123
}
124124
if (IsLabel(v.label)){
125-
$ := v.mode == 3 ? local$ : local$.Value(0)
125+
$ := v.mode == 1 ? local$.Value(0) : local$
126126
gosub, % v.label
127127
} else if (IsFunc(v.label)){
128128
callbackFunc := Func(v.label)
129129
if (callbackFunc.MinParams >= 1){
130-
callbackFunc.(v.mode == 3 ? local$ : local$.Value(0))
130+
callbackFunc.(v.mode == 1 ? local$.Value(0) : local$)
131131
} else {
132132
callbackFunc.()
133133
}
@@ -164,4 +164,4 @@ Hotstring(trigger, label, mode := 1, clearTrigger := 1, cond := ""){
164164
; This label is triggered every time a key is pressed.
165165
Hotstring("", "", "CALLBACK")
166166
return
167-
}
167+
}

0 commit comments

Comments
 (0)