Слежение за нажатием кнопок мыши и колесиком
(используется DirectInput, необходим установленный DirectX 8 или новее) :

Default type: "MOUSE"

ID: "Wheel", "Button0".."Button3"

Value: Current state

Wheel: -120..120
Buttons: 0 - pressed, -1 - released

Mouse.Start() - enable events
Mouse.Stop() - disable events

Эмуляция перемещения мыши и нажатия кнопок:

Mouse( "CLICK", <ButtonID> )
Mouse( "DBLCLICK", <ButtonID> )
Mouse( "DOWN", <ButtonID> )
Mouse( "UP", <ButtonID> )
Mouse( "WHEEL", <movement> )
Mouse( "MOVE,<xID>,<yID>", <X>, <Y>, <HWND> )

ButtonIDs:
"LEFT"
"RIGHT"
"MIDDLE"
or number of X button (1 or 2, Windows 2000/XP only)

Format of MOVE command:

xID:
D - Relative offset
L - Offset from left
R - Offset from right
% - % of width

yID:
D - Relative offset
T - Offset from top
B - Offset from bottom
% - % of height

HWND - window handle, if not specified used Desktop Window


Example (toggle WinAMP visualization mode by mouse click):

Vis = Hook( "KEY", "Ctrl+Alt+Z", true, false ) {
h = Winamp.Mouse( "GET_HANDLE" )
Break( h = 0 )
WinCtrl.Mouse( "ACTIVATE", h )

# move to 70 pixels from left and 45% height of window h
Mouse("MOVE,L,%", 70, 45, h )

# click left button
Mouse("CLICK", "LEFT" )
}