Core Function MouseClick

From Sputnik Wiki
Jump to: navigation, search
MouseClick ( <button>, <x>, <y>, <clicks>, <speed> )

Contents

Description

Perform a mouse click operation.

Parameters

button

The button to click: "left", "right", "middle", "main", "menu", "primary", "secondary".

x

Optional; The x coordinate to move the mouse to. If no x is given, the current position is used.

y

Optional; The y coordinate to move the mouse to. If no y is given, the current position is used.

clicks

Optional; The number of times to click the mouse. Default is 1.

speed

Optional; The speed to move the mouse in the range 1 (fastest) to 100 (slowest).

A speed of 0 will move the mouse instantly.

Default speed is 10.

Return Value

None

Remarks

If the button is an empty string, the left button will be clicked.

If the button is not in the list, then an exception will occur.

If the user has swapped the left and right mouse buttons in the control panel, then the behaviour of the buttons is different. "Left" and "right" always click those buttons, whether the buttons are swapped or not. The "primary" or "main" button will be the main click, whether or not the buttons are swapped. The "secondary" or "menu" buttons will usually bring up the context menu, whether the buttons are swapped or not.

Button 		Normal 		Swapped 
"" 		Left 		Left 
"left" 		Left		Left 
"middle" 	Middle 		Middle 
"right" 	Right 		Right 
"primary" 	Left 		Right 
"main" 		Left 		Right 
"secondary" 	Right 		Left 
"menu" 		Right 		Left 

Example

// Double click at the current mouse pos
MouseClick("left");
MouseClick("left");
 
// Double click at 0,500
MouseClick("left", 0, 500, 2);
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox