#1 - Works perfectly. I expect scrolling the mouse wheel to queue and display 1, 2, 3...
Code: Select all
#Requires AutoHotkey v2.0-beta
global internal := 0 ; local copy of external value.
WheelUp:: {
global internal
internal := internal + 1
fn(internal)
}
WheelDown:: {
global internal
internal := internal - 1
fn(internal)
}
fn(value) {
static log := ""
log .= value "`n" ;", " %valueRef% "`n"
Tooltip log
}
MButton:: Reload
Esc:: ExitApp
Code: Select all
#Requires AutoHotkey v2.0-beta
global internal := 0 ; local copy of external value.
WheelUp:: {
global internal
internal := internal + 1
SetTimer () => fn(internal), -100
}
WheelDown:: {
global internal
internal := internal - 1
SetTimer () => fn(internal), -100
}
fn(value) {
static log := ""
log .= value "`n" ;", " %valueRef% "`n"
Tooltip log
}
MButton:: Reload
Esc:: ExitApp
EDIT: In #2, when I scroll really fast, it does hit the max hotkeys per interval and show a msgbox asking to continue. But where did their calls to SetTimer go?
EDIT 2:: Seems to be related to () => () syntax. Replaceing it with fn.bind(value) works fine.