Divooka Reference

Macro Automation

52 nodes

On this page 52

Activate Window

Function

Brings the window whose title contains this text, ignoring case, to the front and gives it the keyboard - how a macro switches to another program before sending it keys.

Signature
ActivateWindow(title: Text) -> Truth
bool ActivateWindow(string title)

Parameters

nametypedefaultdescription
titleText—Any part of the title as its title bar reads it: "notepad" finds "Untitled - Notepad".

Returns

ActivatedTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Click Mouse

Function

Presses and releases a mouse button where the pointer already is.

Signature
ClickMouse(button: Mouse Button)
void ClickMouse(MacroAutomation.MouseButton button)

Parameters

nametypedefaultdescription
buttonMouse Button—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Click Mouse At

Function

Moves the pointer somewhere and clicks there.

Signature
ClickMouseAt(x: Integer, y: Integer, button: Mouse Button)
void ClickMouseAt(
    int x,
    int y,
    MacroAutomation.MouseButton button)

Parameters

nametypedefaultdescription
xInteger—
yInteger—
buttonMouse Button—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Close Window

Function

Asks a window to close, as its title bar button does. False where nothing happened; the application may still refuse.

Signature
CloseWindow(window: Desktop Window) -> Truth
bool CloseWindow(DesktopWindow window)

Parameters

nametypedefaultdescription
windowDesktop Window—

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Command Process Windows

Function

Applies one command to every window of a named process.

Signature
CommandProcessWindows -> Integer
    processName: Text
    command: Window Command
int CommandProcessWindows(
    string processName,
    WindowCommand command)

Parameters

nametypedefaultdescription
processNameText—
commandWindow Command—

Returns

resultInteger

Remarks

The count rather than a bool, because "minimise that program" over four windows has three
interesting outcomes and not two: none of them, some of them, all of them.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Double Click Mouse

Function

Presses and releases a button twice where the pointer already is.

Signature
DoubleClickMouse(button: Mouse Button)
void DoubleClickMouse(MacroAutomation.MouseButton button)

Parameters

nametypedefaultdescription
buttonMouse Button—

Remarks

Composed from the primitive rather than asked of the platform. Every platform recognises a
double click from two presses inside its own double-click interval, and two presses sent
back to back are always inside it, so a per-platform double click would be three
implementations of a two-line loop - two of them unrunnable here.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Drag

Function

Presses a button at one point, glides to another, and releases.

Signature
Drag
    fromX: Integer
    fromY: Integer
    toX: Integer
    toY: Integer
    button: Mouse Button
    durationMilliseconds: Integer
void Drag(
    int fromX,
    int fromY,
    int toX,
    int toY,
    MacroAutomation.MouseButton button,
    int durationMilliseconds = 300)

Parameters

nametypedefaultdescription
fromXInteger—Where the drag starts.
fromYInteger—Where the drag starts.
toXInteger—Where it ends.
toYInteger—Where it ends.
buttonMouse Button—Which button is held.
durationMillisecondsInteger300Roughly how long the movement between the two takes.

Remarks

The package had no drag at all, so its one real caller wrote one: set cursor, button down,
wait 50 ms, set cursor, button up. That works for a list item and fails for anything with a
drag threshold, because the pointer arrives at the destination in a single jump and the
application never sees it move while held.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Drag Along

Function

Presses a button at the first point, glides through every remaining point in order, and releases at the last.

Signature
DragAlong
    path: Screen Point Array
    button: Mouse Button
    durationMilliseconds: Integer
void DragAlong(
    ScreenPoint[] path,
    MacroAutomation.MouseButton button,
    int durationMilliseconds = 300)

Parameters

nametypedefaultdescription
pathScreen Point Array—Two or more points. One point presses and releases without moving; none does nothing.
buttonMouse Button—Which button is held.
durationMillisecondsInteger300Roughly how long the whole path takes, divided between its segments by length.

Remarks

The multi-point form exists because the package's only real caller receives a path from a
language model's computer-use reply and used path[0] and path[1], silently
discarding the rest - so a gesture drawn round a corner was delivered as a straight line
through it.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Drag Along Paths

Function

Draws a whole pen path: one drag per pen-down..pen-up mark, in order, with the pen lifted between them.

Signature
DragAlongPaths -> (Marks Drawn: Integer, cancelled: Truth)
    marks: IReadOnlyList<Vector2 Array>
    offsetX: Integer
    offsetY: Integer
    button: Mouse Button
    millisecondsPerMark: Integer
    millisecondsBetweenMarks: Integer
    cancelKey: Key
int DragAlongPaths(
    IReadOnlyList<Vector2[]> marks,
    int offsetX,
    int offsetY,
    MacroAutomation.MouseButton button,
    out bool cancelled,
    int millisecondsPerMark = 400,
    int millisecondsBetweenMarks = 60,
    Key cancelKey = Key.None)

Parameters

nametypedefaultdescription
marksIReadOnlyList<Vector2 Array>—One mark per entry, each the ordered points of a single stroke, in the drawing's own coordinates with y downwards. This is the shape a traceable font's pen path arrives in; nothing here knows about fonts, and a plotter file or a hand-written list of points serves equally.
offsetXInteger—Where the drawing's origin sits on the virtual desktop.
offsetYInteger—Where the drawing's origin sits on the virtual desktop.
buttonMouse Button—Which button is held while a mark is drawn.
millisecondsPerMarkInteger400Roughly how long one mark takes, divided between its segments by length.
millisecondsBetweenMarksInteger60How long the pen rests, lifted, between one mark and the next.
cancelKeyKeyNoneA key that stops the run. Read between every two steps of the pointer and through every rest, so a tap is noticed whenever it comes; the mark in progress is released where the pointer is, which leaves a shorter stroke and never a line trailing off somewhere else. Key.None means nothing stops it.

Returns

Marks DrawnInteger
cancelledTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Find Window

Function

The first window whose title contains this text, or DesktopWindow.None.

Signature
FindWindow(titleSubstring: Text) -> Desktop Window
DesktopWindow FindWindow(string titleSubstring)

Parameters

nametypedefaultdescription
titleSubstringText—

Returns

resultDesktop Window
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Find Windows By Process

Function

Every window whose owning process has this name, ignoring case and an .exe suffix.

Signature
FindWindowsByProcess(processName: Text) -> Desktop Window Array
DesktopWindow[] FindWindowsByProcess(string processName)

Parameters

nametypedefaultdescription
processNameText—

Returns

resultDesktop Window Array

Remarks

Above the seam, so "find the window of the program I mean" is written once rather than three
times - two of them on platforms that cannot be run here.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Find Windows By Title

Function

Every window whose title contains this text, ignoring case.

Signature
FindWindowsByTitle(titleSubstring: Text) -> Desktop Window Array
DesktopWindow[] FindWindowsByTitle(string titleSubstring)

Parameters

nametypedefaultdescription
titleSubstringText—

Returns

resultDesktop Window Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Focus Process

Function

Brings a named process's first window to the front.

Signature
FocusProcess(processName: Text) -> Truth
bool FocusProcess(string processName)

Parameters

nametypedefaultdescription
processNameText—

Returns

resultTruth

Remarks

The first rather than all of them, because focusing several windows in turn leaves whichever
went last in front and is indistinguishable from focusing only that one.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Focus Window

Function

Brings a window to the front and gives it the keyboard. False where nothing happened.

Signature
FocusWindow(window: Desktop Window) -> Truth
bool FocusWindow(DesktopWindow window)

Parameters

nametypedefaultdescription
windowDesktop Window—

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Can Read Key State

Function

Whether this machine can be asked what the keyboard is doing, as opposed to only told.

Signature
CanReadKeyState() -> Truth
bool CanReadKeyState()

Returns

resultTruth

Remarks

Separate from MacroAutomation.IsKeyDown because a caller whose stop condition is a key has to be
able to tell "not pressed" from "cannot see the keyboard": a macro that drives the pointer for
minutes and believes the second is the first is a macro nobody can stop. Windows and macOS can;
X11 can when a display opens; nothing else can.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Is Supported

Function

False where nothing here can emulate input on this machine; every call is then a no-op.

Signature
IsSupported() -> Truth
bool IsSupported()

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Platform Name

Function

A short name for a status line: "Windows", "X11", "Quartz", "none".

Signature
PlatformName() -> Text
string PlatformName()

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Support

Function

How far the backend in force is to be trusted. See DesktopInputEmulation.DesktopInputSupport.

Signature
Support() -> Desktop Input Support
DesktopInputSupport Support()

Returns

resultDesktop Input Support
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Get Cursor

Function

Where the pointer is now.

Signature
GetCursor() -> Screen Point
ScreenPoint GetCursor()

Returns

resultScreen Point

Remarks

There was no way to ask this before. The Windows file declared GetCursorPos but left it
private and [Obsolete], so no caller could reach it - and the package's one real
caller has a commented-out SetCursor beside the note that the cursor should not be
moved, which is exactly the case a read-back serves: scroll where the pointer already is.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Get Display At

Function

Which monitor a coordinate is on, or the primary one where it is on none of them.

Signature
GetDisplayAt(x: Integer, y: Integer) -> Display Info
DisplayInfo GetDisplayAt(int x, int y)

Parameters

nametypedefaultdescription
xInteger—
yInteger—

Returns

resultDisplay Info
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Get Displays

Function

Every monitor, with its place on the virtual desktop and its scale.

Signature
GetDisplays() -> Display Info Array
DisplayInfo[] GetDisplays()

Returns

resultDisplay Info Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Get Foreground Window

Function

The window with focus, or DesktopWindow.None where nothing has it.

Signature
GetForegroundWindow() -> Desktop Window
DesktopWindow GetForegroundWindow()

Returns

resultDesktop Window
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Get Own Process Name

Function

This process's own name, so a macro can recognise - and avoid acting on - the windows of the program running it.

Signature
GetOwnProcessName() -> Text
string GetOwnProcessName()

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Get Processes With Windows

Function

The distinct names of every process that owns a window, for a caller offering a list to choose from.

Signature
GetProcessesWithWindows() -> Text Array
string[] GetProcessesWithWindows()

Returns

resultText Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Get Virtual Desktop Bounds

Function

The rectangle every coordinate in this class lives in: the union of every monitor.

Signature
GetVirtualDesktopBounds() -> Screen Rectangle
ScreenRectangle GetVirtualDesktopBounds()

Returns

resultScreen Rectangle

Remarks

Its origin can be negative. That is the whole reason this is a rectangle and not a size, and
the reason the old SM_CXSCREEN / SM_CYSCREEN normalisation could not reach a
second monitor.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Get Window Bounds

Function

Where the first window of a named process is, as four numbers, and whether it was found at all.

Signature
GetWindowBounds(processName: Text) -> (Found: Truth, x: Integer, y: Integer, width: Integer, height: Integer, maximized: Truth)
bool GetWindowBounds(
    string processName,
    out int x,
    out int y,
    out int width,
    out int height,
    out bool maximized)

Parameters

nametypedefaultdescription
processNameText—The owning process, ignoring case and an .exe suffix.

Returns

FoundTruth
xInteger
yInteger
widthInteger
heightInteger
maximizedTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Get Windows

Function

Every top-level window that is on screen and has a title, front-most first where the platform has an order.

Signature
GetWindows() -> Desktop Window Array
DesktopWindow[] GetWindows()

Returns

resultDesktop Window Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Get Window Under Cursor

Function

The front-most window whose bounds contain the pointer, or DesktopWindow.None.

Signature
GetWindowUnderCursor() -> Desktop Window
DesktopWindow GetWindowUnderCursor()

Returns

resultDesktop Window

Remarks

A bounds test over the enumeration, which each backend returns in front-to-back order, so the
first hit is the one a click would land on. It is a bounds test and not a hit test: a click
on a rounded corner or a transparent region of the front window would reach whatever is
behind it, and no platform reports that without asking the window itself.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Is Key Down

Function

Whether a key is physically down right now, whoever has focus.

Signature
IsKeyDown(key: Key) -> Truth
bool IsKeyDown(Key key)

Parameters

nametypedefaultdescription
keyKey—

Returns

resultTruth

Remarks

The keyboard's MacroAutomation.GetCursor: this package could drive a keyboard and could not read
one, so a macro had no way to notice a person asking it to stop. It reads the device rather
than a window's message queue, which is what makes it answerable while the process running the
macro is minimised and has no focus - the state such a macro is normally in, since it has just
got out of the way of whatever it is driving.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Maximize Foreground Window

Function

Maximises the window that currently has focus.

Signature
MaximizeForegroundWindow() -> Truth
bool MaximizeForegroundWindow()

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Maximize Process Windows

Function

Maximises every window of a named process. Returns how many.

Signature
MaximizeProcessWindows(processName: Text) -> Integer
int MaximizeProcessWindows(string processName)

Parameters

nametypedefaultdescription
processNameText—

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Maximize Window

Function

Fills the window's monitor with it. False where nothing happened.

Signature
MaximizeWindow(window: Desktop Window) -> Truth
bool MaximizeWindow(DesktopWindow window)

Parameters

nametypedefaultdescription
windowDesktop Window—

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Minimize Foreground Window

Function

Iconifies the window that currently has focus.

Signature
MinimizeForegroundWindow() -> Truth
bool MinimizeForegroundWindow()

Returns

resultTruth

Remarks

This is what HideEditor did, under a name that says so. The old name described a
caller's intent rather than the operation - it minimised whatever was in front, whether or not
that was an editor - and it was the package's entire window vocabulary.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Minimize Process Windows

Function

Iconifies every window of a named process. Returns how many.

Signature
MinimizeProcessWindows(processName: Text) -> Integer
int MinimizeProcessWindows(string processName)

Parameters

nametypedefaultdescription
processNameText—

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Minimize Window

Function

Iconifies a window. False where nothing happened.

Signature
MinimizeWindow(window: Desktop Window) -> Truth
bool MinimizeWindow(DesktopWindow window)

Parameters

nametypedefaultdescription
windowDesktop Window—

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Move Cursor

Function

Moves the pointer by a delta from wherever it is.

Signature
MoveCursor(dx: Integer, dy: Integer)
void MoveCursor(int dx, int dy)

Parameters

nametypedefaultdescription
dxInteger—
dyInteger—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Move Cursor Smoothly

Function

Moves the pointer to an absolute coordinate over time, accelerating and decelerating.

Signature
MoveCursorSmoothly
    x: Integer
    y: Integer
    durationMilliseconds: Integer
void MoveCursorSmoothly(
    int x,
    int y,
    int durationMilliseconds = 250)

Parameters

nametypedefaultdescription
xInteger—Destination x, in virtual-desktop coordinates.
yInteger—Destination y.
durationMillisecondsInteger250Roughly how long the movement should take.

Remarks

A pointer that teleports is the single most reliable signature of emulated input: some
applications ignore a click whose press arrives in the same input batch as the move that got
there, and hover states, drag thresholds and tooltips never fire at all. The easing is a
smoothstep, so the motion starts and ends slowly, which is also what makes the intermediate
positions land on the widgets a real hand would have crossed.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Press Key

Function

Presses and releases a key, optionally holding modifiers while it is pressed.

Signature
PressKey(key: Key, modifiers: Key Modifiers)
void PressKey(
    Key key,
    KeyModifiers modifiers = KeyModifiers.None)

Parameters

nametypedefaultdescription
keyKey—The key to press.
modifiersKey ModifiersNoneKeys held down for the duration of the press. None by default.

Remarks

Modifiers are pressed in a fixed order and released in the reverse of it, so a chord leaves
the keyboard exactly as it found it. Releasing in the same order as pressing is how an
emulated chord leaves a modifier stuck down - the failure the package README already
records as a "weird sticky key issue".

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Press Key Combination

Function

Presses a chord given as keys: every key but the last is held, the last is pressed, and the held ones are released in reverse.

Signature
PressKeyCombination(keys: Key Array)
void PressKeyCombination(Key[] keys)

Parameters

nametypedefaultdescription
keysKey Array—

Remarks

This is the shape a language model's computer-use reply arrives in - ["ctrl", "c"] -
and the shape the package could not express. The one real caller looped over the array
calling the old PressKey once per name, which pressed and released Control on its own
and then typed a lower-case "c".

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Restore Process Windows

Function

Brings back every minimised window of a named process, each as it was before it was minimised, and leaves its other windows as they are. Returns how many came back.

Signature
RestoreProcessWindows(processName: Text) -> Integer
int RestoreProcessWindows(string processName)

Parameters

nametypedefaultdescription
processNameText—

Returns

resultInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Restore Window

Function

Puts a minimised or maximised window back to its previous size. False where nothing happened.

Signature
RestoreWindow(window: Desktop Window) -> Truth
bool RestoreWindow(DesktopWindow window)

Parameters

nametypedefaultdescription
windowDesktop Window—

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Scroll Absolute

Function

Scrolls vertically. Positive scrolls down, as one detent of a wheel.

Signature
ScrollAbsolute(scrollY: Integer)
void ScrollAbsolute(int scrollY)

Parameters

nametypedefaultdescription
scrollYInteger—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Scroll Horizontal

Function

Scrolls horizontally. Positive scrolls right.

Signature
ScrollHorizontal(scrollX: Integer)
void ScrollHorizontal(int scrollX)

Parameters

nametypedefaultdescription
scrollXInteger—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Send Text

Function

Types text into whatever has focus, as characters rather than key positions.

Signature
SendText(text: Text, settleMilliseconds: Integer)
void SendText(string text, int settleMilliseconds = 0)

Parameters

nametypedefaultdescription
textText—The text to type.
settleMillisecondsInteger0How long to wait afterwards. Zero by default.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Set Cursor

Function

Puts the pointer at an absolute virtual-desktop coordinate, immediately.

Signature
SetCursor(x: Integer, y: Integer)
void SetCursor(int x, int y)

Parameters

nametypedefaultdescription
xInteger—
yInteger—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Set Key State

Function

Holds a key down, or lets it up, without the other half.

Signature
SetKeyState(key: Key, pressed: Truth)
void SetKeyState(Key key, bool pressed)

Parameters

nametypedefaultdescription
keyKey—
pressedTruth—

Remarks

A caller that takes a key down is responsible for putting it back up. Everything composed in
this class pairs its own presses, which is why nothing here can leave a modifier stuck.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Set Mouse State

Function

Presses or releases a mouse button without releasing it again.

Signature
SetMouseState(button: Mouse Button, pressed: Truth)
void SetMouseState(
    MacroAutomation.MouseButton button,
    bool pressed)

Parameters

nametypedefaultdescription
buttonMouse Button—
pressedTruth—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Try Enable Per Monitor Dpi Awareness

Function

Asks Windows to treat this process as per-monitor DPI aware, so the coordinates here are real pixels.

Signature
TryEnablePerMonitorDpiAwareness() -> Truth
bool TryEnablePerMonitorDpiAwareness()

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Try Press Key Named

Function

Presses a key named as text, including a chord written as one string: "Enter", "esc", "ctrl+c".

Signature
TryPressKeyNamed(keyName: Text) -> Truth
bool TryPressKeyNamed(string keyName)

Parameters

nametypedefaultdescription
keyNameText—

Returns

resultTruth

Remarks

The string-taking entry point survives, because the caller that needs one receives key names
from a language model and cannot be given an enum. What has gone is the guessing: the old
method parsed, caught whatever the parse threw, prepended VK_ and parsed again, so an
unrecognised name surfaced as an ArgumentException about a key the caller never wrote.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Try Press Keys Named

Function

Presses a chord named as separate strings, as ["ctrl", "shift", "n"].

Signature
TryPressKeysNamed(keyNames: Text Array) -> Truth
bool TryPressKeysNamed(string[] keyNames)

Parameters

nametypedefaultdescription
keyNamesText Array—

Returns

resultTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Wait

Function

Waits, in milliseconds.

Signature
Wait(milliseconds: Integer)
void Wait(int milliseconds)

Parameters

nametypedefaultdescription
millisecondsInteger—

Remarks

Through the backend rather than straight to Thread.Sleep, so a test that has installed
a DesktopInputEmulation.RecordingDesktopInput can assert what a macro asked to wait for without
spending it. Its default implementation is Thread.Sleep.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation

Wait Unless Key Down

Function

Waits, unless a key goes down first - in which case it stops waiting there and says so.

Signature
WaitUnlessKeyDown(milliseconds: Integer, key: Key) -> Truth
bool WaitUnlessKeyDown(int milliseconds, Key key)

Parameters

nametypedefaultdescription
millisecondsInteger—The longest it waits.
keyKey—The key that cuts the wait short, read from the device as MacroAutomation.IsKeyDown reads it.

Returns

Key DownTruth
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Macro Automation
Package
Desktop Automation