Skip to content

Commit

Permalink
Use the new manifesthooks function to improve performance.
Browse files Browse the repository at this point in the history
  • Loading branch information
samhocevar committed Apr 17, 2014
1 parent 1cea8db commit e68dd02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ahk
Submodule ahk updated from ad9f75 to f55cc0
6 changes: 6 additions & 0 deletions src/main.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,14 @@ set_ascii_hotkeys(must_enable)
c2 := c1 . "\ !""#$%&'()*+,-./0123456789:;<=>?@[\\]^_`{|}~"

flag := must_enable ? "on" : "off"
manifesthooks off
loop, parse, c1
hotkey $+%a_loopfield%, key_callback, %flag%, useerrorlevel
loop, parse, c2
hotkey $%a_loopfield%, key_callback, %flag%, useerrorlevel
for key, val in C.keys.numpad
hotkey $%key%, key_callback, %flag%, useerrorlevel
manifesthooks on

return

Expand All @@ -313,11 +315,13 @@ set_special_hotkeys(must_enable)
{
flag := must_enable ? "on" : "off"

manifesthooks off
for ignored, key in C.keys.special
{
hotkey $%key%, special_callback, %flag%, useerrorlevel
hotkey $%key% up, special_callback, %flag%, useerrorlevel
}
manifesthooks on

return

Expand Down Expand Up @@ -356,6 +360,7 @@ set_compose_hotkeys(must_enable)
; obviously in this case we need to add hooks for LControl + RAlt.
compose_prefixes := [ "$", "$^", "$+", "$!" ]

manifesthooks off
if (must_enable)
{
; Make sure that 1-character hotkeys are activated; these may have
Expand Down Expand Up @@ -383,6 +388,7 @@ set_compose_hotkeys(must_enable)
}
}
}
manifesthooks on

return

Expand Down

0 comments on commit e68dd02

Please sign in to comment.