The behavior now matches the description in the documentation precisely.v1.1.30.02 wrote:Fixed #if expressions stalling in Sleep and similar.
#IfTimeout reads:
To illustrate the issue, I have prepared the following piece of code:The timeout in ms, default 1000ms. If the timeout is exceeded, the expression will continue to evaluate, however, the hook will behave as though it had evaluated to false.
Code: Select all
#If delay()
Space::MsgBox
delay() {
Sleep 1
return true
}
I would expect that, as long as delay() takes less than a 1000 ms to execute, pressing Space should display a MsgBox.
What I observe, however, is quite different. The moment I press Space, the script will hang for, according to guesstimation, about 200 ms, during which time all keystrokes will be buffered. Once that has elapsed, all buffered keystrokes are reproduced instantaneously, in the order that they were captured. The #If directive has at this point evaluated to false. The Space hotkey is never triggered, and no MsgBox is ever displayed.
The 1.1.30.01 Unicode x64 interpreter was used to run this uncompiled script on Windows 10 1809 x64. No other scripts were running during testing. Neither were, to the best of my knowledge, any other programs that could interfere with the keyboard hook.
I was also unable to locate the value LowLevelHooksTimeout, supposedly residing in HKEY_CURRENT_USER\Control Panel\Desktop per the documentation instructions.