Skip to main content

Simulate-Click

Command Description

Simulate Click

Command Prototype

Mouse.Click(iButton, iType, sKeyModifiers,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
iButtonTrueenum"left"Mouse button {left: Left button, right: Right button, middle: Middle button}
iTypeTrueenum"click"Click type {click: single click, dbclick: double click, down: keydown, up: keyup}
sKeyModifiersTrueset[]Keyboard keys used while a mouse action is triggered: Alt, Ctrl, Shift, Win
iDelayAfterNonenumber300Delay time (in milliseconds) after executing the activity is 300 milliseconds
iDelayBeforeNonenumber200The delay time (in milliseconds) before any operations are executed is by default 200 milliseconds

Demo

TracePrint "--------------------Simulate Click--------------------" 
// --------------------------------------------------------
// [Note] To simulate a click, the Demo needs to open the IE browser to jump to the Baidu homepage, and use it with the "Move to the target" command
// Input parameter 1:
// iButton--mouse click (left/right/middle)
// Input parameter 2:
// iType--click type (click / double click / press / pop up)
// Input parameter 3:
// sKeyModifiers--Auxiliary keys
// Input parameter 4:
// optionArgs--Optional parameters (including: delay after execution/delay before execution).Type:Dict

// Command prototype: Mouse.Click(iButton, iType, sKeyModifiers,optionArgs)
// --------------------------------------------------------

// move to the specified target
Mouse.Hover(@ui"Input control<input>_Baidu Yiyi 7",10000,{"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200, "bSetForeground": true, "sCursorPosition": "Center", "iCursorOffsetX": 10, "iCursorOffsetY": 10, "sKeyModifiers": [],"sSimulate": "simulate", "bMoveSmoothly" : false})
// perform the click action
Mouse.Click("left", "click", [],{"iDelayAfter": 300, "iDelayBefore": 300})