Skip to content

Commit

Permalink
Merge branch 'hook'
Browse files Browse the repository at this point in the history
  • Loading branch information
8LWXpg committed May 20, 2024
2 parents d214df9 + 43b4c53 commit a679806
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions RegExHotstring.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,20 @@ class RegExHk extends InputHook {
*/
OnKeyUp(c, Callback) {
static store := Map()
store[c] := InputHook("VI")
hook := store[c]
if store.Has(c) {
return
}

hook := store[c] := InputHook("VI")
hook.KeyOpt(c, "+N")
hook.OnKeyUp := KeyUp
hook.Dispose := (*) => store.Delete(c)
hook.Start()

KeyUp(ih, vk, sc) {
KeyUp(ih, *) {
Callback()
ih.Stop()
ih.Dispose()
ih := ""
}
}

0 comments on commit a679806

Please sign in to comment.