Keyboard and Clipboard Events
This section describes the Eggplant Functional commands and functions that act upon the SUT's keyboard and clipboard.
KeyDown
Command
Behavior: Presses and holds the given keys until they are released by the KeyUp
command.
Parameters: Keyboard characters (in quotation marks); TypeText keywords (with no quotation marks).
Syntax:
KeyDown keysToPress
Example:
KeyDown ControlKey, CommandKey, "d"
Example:
//Use code like this to select multiple items, such as files in File Explorer/Finder, and then copy the files
Click "FirstEntry" //Clicks the hot spot of image "FirstEntry"
KeyDown ControlKey //Holds down the control key
Click "LastEntry" //Clicks the hot spot of image "LastEntry"
KeyUp ControlKey //Releases the control key
RightClick //Right-clicks at the same location as the previous mouse event
Click "CopyMenuItem"
Related: KeyUp
Command