The Move or Click Mouse action allows you to move, click or move and click the mouse using any mouse button, and optionally dragging.
You can specify modifiers such as the shift key, as well as the position, relative to any corner of the front window, the main screen, or the current mouse location, or a found image on the screen.
As you select options further settings may become available. For example, if you click then you can also choose a button to click with and whether or not to also press a modifier key such as Control.
Select zero or more modifier keys by clicking the relevant icon:
When a modifier key is included the icon is filled with blue.
To get the relative distance (offset) of the Mouse position relative to some location, like the window top, left corner, use the Get button after you have set the relative to location.
The Go and Get Buttons are used only during setup of the Action. They have no effect when the macro is executed.
Specify from the pop-up whether the click operation is:
Notes:
You can also click relative to a Found Image. By default the image has to be unique (which includes not being visible in the action if the image is small enough not to be shrunk in the image well) otherwise Keyboard Maestro will not know where to click. Alternatively, you can specify which image to click (Best, Topmost, Leftmost, Bottommost or Rightmost). You can also use the Find Image on Screen action or the For Each action with the Found Images collection to find all matching images and click on them as appropriate.
Remember when specifying the area, as with all numeric fields, the numbers can be calculations including functions, and the fields expand to allow for longer expressions as soon as you type something other than a number, so this allows very precise control of where you can match.
Note that in the above screen shot, the WINDOW(0,Left)
function is referring to the frontmost window in the frontmost app. To refer to other windows in the frontmost app, you need to change the index
parameter of the WINDOW function.
If the click offsets are all fixed values (not calculations), you can select the image well and press SPACE to show the image with the location of the click displayed on the image (v11.0+).
There is an option in the action (gear) ⚙ menu to have the action wait until the image appears (v11.0+).