Skip to main content

Simulate-Key

Command Description

Simulate Keyboard key

Command Prototype

Keyboard.Press(sKey, sType, sKeyModifiers,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
sKeyTrueenum"Enter"Correspond to the content to be entered in one simulation
sTypeTrueenum"press"The button types are: click (press), press (down), up (up)
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
sSimulateNoneenum"simulate"The available operation types: Simulation operation(simulate)、 System message(message); by default: Simulation operation(simulate)

Demo

TracePrint "--------------------simulate keypress--------------------" 
// --------------------------------------------------------
// [Remarks] Simulate button
// Input parameter 1:
// sKey--simulate keys
// Input parameter 2:
// sType--key type (click/double-click/press/bounce)
// Input parameter 3:
// sKeyModifiers--Auxiliary keys
// Input parameter 4:
// optionArgs--Optional parameters (including: error continue execution/delay after execution/delay before execution/operation type).Type:Dict

// Command prototype: Keyboard.Press(sKey, sType, sKeyModifiers,optionArgs)
// --------------------------------------------------------

Keyboard.Press("Enter", "press", [],{"iDelayAfter": 300, "iDelayBefore": 200, "sSimulate": "simulate"})