From 53d56b4d609d64733b7f309599b55fe312b89bc3 Mon Sep 17 00:00:00 2001 From: guest3456 Date: Fri, 5 Jan 2018 12:27:36 -0500 Subject: [PATCH] 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!" } --- Hotstring.ahk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Hotstring.ahk b/Hotstring.ahk index e2c64ea..3492661 100644 --- a/Hotstring.ahk +++ b/Hotstring.ahk @@ -107,7 +107,7 @@ Hotstring(trigger, label, mode := 1, clearTrigger := 1, cond := ""){ A_LoopCond := Func(v.cond) if (A_LoopCond.MinParams >= 1){ ; If the function has atleast 1 parameters. - A_LoopRetVal := A_LoopCond.(v.mode == 3 ? local$ : local$.Value(0)) + A_LoopRetVal := A_LoopCond.(v.mode == 1 ? local$.Value(0) : local$) } else { A_LoopRetVal := A_LoopCond.() } @@ -122,12 +122,12 @@ Hotstring(trigger, label, mode := 1, clearTrigger := 1, cond := ""){ SendInput % "{BS " . StrLen(local$.Value(0)) . "}" } if (IsLabel(v.label)){ - $ := v.mode == 3 ? local$ : local$.Value(0) + $ := v.mode == 1 ? local$.Value(0) : local$ gosub, % v.label } else if (IsFunc(v.label)){ callbackFunc := Func(v.label) if (callbackFunc.MinParams >= 1){ - callbackFunc.(v.mode == 3 ? local$ : local$.Value(0)) + callbackFunc.(v.mode == 1 ? local$.Value(0) : local$) } else { callbackFunc.() } @@ -164,4 +164,4 @@ Hotstring(trigger, label, mode := 1, clearTrigger := 1, cond := ""){ ; This label is triggered every time a key is pressed. Hotstring("", "", "CALLBACK") return -} \ No newline at end of file +}