

For those applications, use a Loop to turn the wheel more than one notch as in this example, which turns it 5 notches: Loop, 5ĬontrolClick, Control, WinTitle, WinText, WheelUp Not all applications obey a ClickCount higher than 1 for turning the mouse wheel.
#AUTOHOTKEY RAPIDCLICK WINDOWS#
However, this method might not work for all types of windows and controls. NA avoids marking the target window as active and avoids merging its input processing with that of the script, which may prevent physical movement of the mouse from interfering (but usually only when the target window is not active). This avoids holding the mouse button down during the click, which in turn reduces interference from the user's physical movement of the mouse.Ģ) Specify the string NA anywhere in the sixth parameter ( Options) as shown below: SetControlDelay -1ĬontrolClick, Toolbar321, WinTitle, NA To improve reliability - especially during times when the user is physically moving the mouse during the ControlClick - one or both of the following may help:ġ) Use SetControlDelay -1 prior to ControlClick. For more information, see Runtime Errors.ĮrrorLevel is set to 1 if there was a problem or 0 otherwise. : This command is able to throw an exception on failure. Windows whose text include this value will not be considered. Windows whose titles include this value will not be considered. Use decimal (not hexadecimal) numbers for the X and Y options. If unspecified, the click will occur at the vertical-center of the control. Yn: Specify for n the Y position to click at, relative to the control's upper left corner. If unspecified, the click will occur at the horizontal-center of the control. Xn: Specify for n the X position to click at, relative to the control's upper left corner. Pos: Specify the word Pos anywhere in Options to unconditionally use the X/Y positioning mode as described in the Control-or-Pos parameter above. This option should not be present if the D option is already present (and vice versa). If both the D and U options are absent, a complete click (down and up) will be sent. See reliability below.ĭ: Press the mouse button down but do not release it (i.e.

#AUTOHOTKEY RAPIDCLICK SERIES#
OptionsĪ series of zero or more of the following option letters. The number of clicks to send, which can be an expression. In this case, ClickCount is the number of notches to turn the wheel. Windows Vista or later : WheelLeft (or WL) and WheelRight (or WR) are also supported (they have no effect on older operating systems). WheelUp (or WU) and WheelDown (or WD) are also supported. X1 (XButton1, the 4th mouse button) and X2 (XButton2, the 5th mouse button) are also supported. If omitted or blank, the LEFT button will be used. The button to click: LEFT, RIGHT, MIDDLE (or just the first letter of each of these). Hidden text elements are detected if DetectHiddenText is ON. If present, this parameter must be a substring from a single text element of the target window (as revealed by the included Window Spy utility). WinTitleĪ window title or other criteria identifying the target window. The HWND of a control is typically retrieved via ControlGet Hwnd, MouseGetPos, or DllCall. To operate upon a control's HWND (window handle), leave this parameter blank and specify ahk_id %ControlHwnd% for the WinTitle parameter (this also works on hidden controls even when DetectHiddenWindows is Off). To override this and use mode 1 unconditionally, specify the word Pos in Options as in the following example: ControlClick, x255 y152, WinTitle, Pos. For example, in the unlikely event that there is a control whose text or ClassNN has the format "Xnnn Ynnn", it would be acted upon by Mode 2.

When using name/text, the matching behavior is determined by SetTitleMatchMode.īy default, mode 2 takes precedence over mode 1. Mode 2 (ClassNN or Text): Specify either ClassNN (the classname and instance number of the control) or the name/text of the control, both of which can be determined via Window Spy.

Note: In mode 1, the X and Y option letters of the Options parameter are ignored. If there is no control, the target window itself will be sent the event (which might have no effect depending on the nature of the window). If there is a control at the specified coordinates, it will be sent the click-event at those exact coordinates. The X coordinate must precede the Y coordinate and there must be at least one space or tab between them. Mode 1 (Position): Specify the X and Y coordinates relative to the target window's upper left corner. Otherwise, one of the two modes below will be used. If this parameter is blank, the target window's topmost control will be clicked (or the target window itself if it has no controls). Sends a mouse button or mouse wheel event to a control.
