Citation :
Mouse Wheel Hotkeys [Windows NT/2000/XP or later]
Hotkeys that fire upon turning the mouse wheel are supported via the key names WheelDown and WheelUp. For example:
MButton & WheelDown::MsgBox You turned the mouse wheel down while holding down the middle button.
^!WheelUp::MsgBox You rotated the wheel up while holding down Control+Alt.In v1.0.43.03+, the built-in variable A_EventInfo contains the number of notches by which the wheel was turned, which is always at least 1. Integers higher than 1 typically occur when the wheel is being turned quickly (though how common this is depends on the granularity of the mouse hardware). Example usage: ~WheelDown::ToolTip %A_EventInfo%
Some of the most useful hotkeys for the mouse wheel involve alternate modes of scrolling a window's text. For example, the following pair of hotkeys scrolls horizontally instead of vertically when you turn the wheel while holding down the left Control key:
~LControl & WheelUp:: ; Scroll left.
ControlGetFocus, fcontrol, A
Loop 2 ; <-- Increase this value to scroll faster.
SendMessage, 0x114, 0, 0, %fcontrol%, A ; 0x114 is WM_HSCROLL and the 0 after it is SB_LINERIGHT.
return
~LControl & WheelDown:: ; Scroll right.
ControlGetFocus, fcontrol, A
Loop 2 ; <-- Increase this value to scroll faster.
SendMessage, 0x114, 1, 0, %fcontrol%, A ; 0x114 is WM_HSCROLL and the 1 after it is SB_LINELEFT.
returnFinally, since mouse wheel hotkeys generate only down-events (never up-events), they cannot be used as key-up hotkeys.
|