Skip to content

Commit

Permalink
v4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
8LWXpg committed Apr 5, 2024
1 parent 9a7688f commit 06d7b66
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,25 @@ RegExHotstring(String, CallBack, Options, OnOffToggle, Params*)

![Demo.gif](demo.gif)

## FAQ

### How to trigger regular hotstring in the same script?

Set `SendLevel` higher than `#InputLevel` (default is `0`), and set `RegHook.MinSendLevel` higher than `SendLevel` to avoid triggering `InputHook` recursively.

```ahk
#Include RegExHotstring.ahk
::btw::by the way
RegHook.MinSendLevel := 2
SendLevel(1)
RegExHotstring(...)
```

> [!IMPORTANT]
> Only last `SendLevel` taking effect.
## Limitations

- incompatible with `#IfWin` or `#HotIf`
Expand Down
4 changes: 1 addition & 3 deletions RegExHotstring.ahk
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#Requires AutoHotkey v2.0

; this send level allows trigger hotstring in same script
SendLevel(1)
RegHook := RegExHk("VI2")
RegHook := RegExHk("VI")
RegHook.NotifyNonText := true
RegHook.VisibleText := false
RegHook.KeyOpt("{Space}{Tab}{Enter}{NumpadEnter}{BackSpace}", "+SN")
Expand Down

0 comments on commit 06d7b66

Please sign in to comment.