Hotkeys that fire upon turning the mouse wheel are supported via the key names WheelDown and WheelUp. WheelLeft and WheelRight are also supported in v1.0.48+, but have no effect on operating systems older than Windows Vista. Here are some examples of mouse wheel hotkeys:
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 amount by which the wheel was turned, which is typically 1. However, A_EventInfo can be greater or less than 1 under the following circumstances: if the mouse hardware reports distances of less than one notch, A_EventInfo may contain 0; if the wheel is being turned quickly (depending on type of mouse), A_EventInfo may be greater than 1. 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_LINELEFT.
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_LINERIGHT.
return
Finally, since mouse wheel hotkeys generate only down-events (never up-events), they cannot be used as key-up hotkeys.
Подписаться на:
Комментарии к сообщению (Atom)
Комментариев нет:
Отправить комментарий