robot
Contains functions for working with clipboard, processes, automation
Constants
BUTTON1
: number = 16
left mouse button code
BUTTON2
: number = 8
middle mouse button code
BUTTON3
: number = 4
right mouse button code
VK_DOWN
: number = 40
key down code
VK_ESCAPE
: number = 27
Escape key code
VK_FIRE
: number = 10
Enter key code
VK_LEFT
: number = 37
key left code
VK_RIGHT
: number = 39
key right code
Functions
click(buttons)
desktop — performs click with given mouse buttons
use robot
click(BUTTON3) // right mouse button click
delay(ms)
desktop — delay by given milliseconds
execProcess(args...)
— executes the process with parameters
use robot
execProcess("mkdir", "Test")
execProcess("mkdir Test")
execProcess(["mkdir", "Test"])
execProcessAndWait(args...)
— same as execProcess
, but waits until process completes, returns it's exit code
fromClipboard()
— gets text from clipboard
keyPress(key)
desktop — performs pressing key
keyRelease(key)
desktop — performs releasing key
mouseMove(x, y)
desktop — moves mouse pointer to given point
mousePress(buttons)
desktop — performs pressing the given mouse button
mouseRelease(buttons)
desktop — performs releasing the given mouse button
mouseWheel(value)
desktop — performs scrolling (< 0 - up, > 0 - down)
setAutoDelay(ms)
desktop — sets delay after each automation event
toClipboard(text)
— adds text to clipboards
typeText(text)
desktop — performs typing text by pressing keys for each character
sudo(args...)
android — same as execProcess
, but executes command as root (requires rooted device)