
The Click command uses the sending method set by SendMode. The Click command is generally preferred over MouseClick because it automatically compensates if the user has swapped the left and right mouse buttons via the system's control panel. In other words, the cursor will be moved from its current position by X pixels to the right (left if negative) and Y pixels down (up if negative). Relative: The word Rel or Relative treats the specified X and Y coordinates as offsets from the current mouse position. For example, Click, Down presses down the left mouse button and holds it. Later, use the word Up (or the letter U) to release the mouse button. Otherwise, specify the word Down (or the letter D) to press the mouse button down without releasing it. Specify zero (0) to move the mouse without clicking for example, Click, 100 200 0.ĭownOrUp: This component is normally omitted, in which case each click consists of a down-event followed by an up-event. If Coords is specified, ClickCount must appear after it. For example, Click, 2 performs a double-click at the mouse cursor's current position. For them, use the Click command multiple times by means such as Loop.ĬlickCount: The number of times to click the mouse. However, some applications do not obey a ClickCount value higher than 1 for the mouse wheel. For ClickCount, specify the number of notches to turn the wheel.
ONE CLICK CODE WINDOWS
: WheelLeft (or WL) or WheelRight (or WR) may also be specified (but they have no effect on older operating systems older than Windows Vista). WhichButton can also be WheelUp or WU to turn the wheel upward (away from you), or WheelDown or WD to turn the wheel downward (toward you). Unlike MouseClick, the left and right buttons behave consistently across all systems, even if the user has swapped the buttons via the system's control panel. For example, Click, Right clicks the right mouse button at the mouse cursor's current position. WhichButton: Left (default), Right, Middle (or just the first letter of each of these) or the fourth or fifth mouse button (X1 or X2). If omitted, the cursor's current position is used. Coordinates are relative to the active window unless CoordMode was used to change that. For example, Click, 100 200 clicks the left mouse button at a specific position. The components can appear in any order except ClickCount, which must occur somewhere to the right of Coords, if present.Ĭoords: The X and Y coordinates to which the mouse cursor is moved prior to clicking. Infosys Foundation USA, Facebook, Microsoft, Amazon, Ballmer Group, Ali and Hadi Partovi, Bill and Melinda Gates Foundation, Vista Equity Partners, PricewaterhouseCoopers, Google, Imaginable Futures, Salesforce, BlackRock, Verizon, John and Ann Doerr, Sean Parker, Reid Hoffman, Pluralsight One, The Marie-Jose and Henry R. Separate each component from the next with at least one space, tab, and/or comma. Specify zero or more of the following components: Coords, WhichButton, ClickCount, DownOrUp, and/or Relative. It can also hold down a mouse button, turn the mouse wheel, or move the mouse. Click - Syntax & Usage | AutoHotkey Click Ĭlicks a mouse button at the specified coordinates.
