Skip to content

testudos.api.input

testudos.api.input

Synthetic mouse and drag helpers (engine RPC).

Coordinates are item-local when provided; omit x and y to use the item center (sentinel -1 on the wire). Matches QML semantics used by simulateClick.

click_button

def click_button(target: Any) -> None

Invoke click() when available, otherwise synthetic click at center.

mouse_click

def mouse_click(target: Any,
x: int | None = None,
y: int | None = None) -> None

Left press and release on target.

Arguments:

  • target - Object name or QtObjectProxy. x, y: Optional local coordinates; both required if either is given.

double_click

def double_click(target: Any,
x: int | None = None,
y: int | None = None) -> None

Two consecutive left clicks at the same position.

mouse_press

def mouse_press(target: Any,
x: int | None = None,
y: int | None = None) -> None

Left button press only.

mouse_release

def mouse_release(target: Any,
x: int | None = None,
y: int | None = None) -> None

Left button release only.

mouse_move

def mouse_move(target: Any,
x: int | None = None,
y: int | None = None) -> None

Move with no buttons (hover).

drag_and_drop

def drag_and_drop(source: Any, target: Any) -> None

Press at source center, drag to target center, release.

drag_and_drop_at

def drag_and_drop_at(source: Any, source_x: int, source_y: int, target: Any,
target_x: int, target_y: int) -> None

Drag using explicit local coordinates on source and target.

set_focus

def set_focus(target: Any) -> None

Set keyboard focus on target (object name or QtObjectProxy).

key_press

def key_press(key: str) -> None

Press a key (does not release).

key_release

def key_release(key: str) -> None

Release a key.

key_click

def key_click(key: str) -> None

Press and release a key.

type_text

def type_text(target: Any, text: str) -> None

Type text into target (object must accept keyboard input).