From 06d7b664d77b7b020f563c3aae01f05e6f40e09d Mon Sep 17 00:00:00 2001 From: 8LWXpg <105704427+8LWXpg@users.noreply.github.com> Date: Sat, 6 Apr 2024 00:26:19 +0800 Subject: [PATCH] v4.2 --- README.md | 19 +++++++++++++++++++ RegExHotstring.ahk | 4 +--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 21182dc..e732df7 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/RegExHotstring.ahk b/RegExHotstring.ahk index 98b315a..8be1cb3 100644 --- a/RegExHotstring.ahk +++ b/RegExHotstring.ahk @@ -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")