Thanks, that's perfect!
For others who may be interested, it's possible to exclude returns and tabs in a similar fashion:
hs(c, a = "") {
static d, b, q
global $
v = `n,€,~$,Numpad,BS,Space[color=red],Tab,Return[/color]
StringSplit, v, v, `,
If !d {
Loop, 104
Hotkey, % Chr(42 * !!RegExMatch(t := Chr(32 + (x := A_Index))
, "[a-z]")) . v3 . (x > 94 ? v4 . x - 95 : t), _hs
Hotkey, %v3%%v5%, _hs
d := 1
}
If a
Return, !!b .= c . v2 . a . v1
If c = %v3%%v5%
Return, !!q := SubStr(q, 1, -1)
If c = %v3%%v6%
Return, !!q := SubStr(q, 1, -1)
[color=red] If c = %v3%%v7%
Return, !!q := SubStr(q, 1, -1)
If c = %v3%%v8%
Return, !!q := SubStr(q, 1, -1)[/color]
If GetKeyState("Shift", "P") or GetKeyState("Capslock", "T")
StringUpper, c, c
Else StringLower, c, c
q .= SubStr(c, StrLen(v3) + !!InStr(c, v4) * StrLen(v4) + 1 + !!InStr(c, "*"))
Loop, Parse, b, %v1%
{
If (c := RegExMatch(q, SubStr(t := A_LoopField, 1
, InStr(t, v2) - 1) . "$", $)) and t {
f += RegExMatch(t, ".+" . v2 . "(.+)", l)
SendInput, % "{BS " . StrLen($) . "}"
Transform, l, Deref, %l1%
If IsLabel(l)
GoSub, %l%
Else SendInput, %l%
}
}
If f
q =
}
~$space::
[color=red]~$return::
~$tab::[/color]
_hs:
hs(A_ThisHotkey)
Return