SendMouse

The $command parameter is a string containing one or more of the following substrings:

NameAction
{LEFTDOWN}Left button down
{LEFTUP}Left button up
{MIDDLEDOWN}Middle button down
{MIDDLEUP}Middle button up
{RIGHTDOWN}Right button down
{RIGHTUP}Right button up
{LEFTCLICK}Left button single click
{MIDDLECLICK}Middle button single click
{RIGHTCLICK}Right button single click
{ABSx,y}Move to absolute coordinate (x,y)
{RELx,y}Move to relative coordinate (x,y)

Note: Absolute mouse coordinates range from 0 to 65535. Relative coordinates can be positive or negative. If you need pixel coordinates you can use MouseMoveAbsPix.

Also equivalent low-level functions are available: