computer

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button string
const (
	ButtonLeft    Button = "left"
	ButtonRight   Button = "right"
	ButtonWheel   Button = "wheel"
	ButtonBack    Button = "back"
	ButtonForward Button = "forward"
)

type Computer

type Computer interface {
	Environment(context.Context) (Environment, error)
	Dimensions(context.Context) (Dimensions, error)
	Screenshot(context.Context) (string, error)
	Click(ctx context.Context, x, y int64, button Button) error
	DoubleClick(ctx context.Context, x, y int64) error
	Scroll(ctx context.Context, x, y int64, scrollX, scrollY int64) error
	Type(ctx context.Context, text string) error
	Wait(context.Context) error
	Move(ctx context.Context, x, y int64) error
	Keypress(ctx context.Context, keys []string) error
	Drag(ctx context.Context, path []Position) error
}

A Computer interface abstracts the operations needed to control a computer or browser.

type Dimensions

type Dimensions struct {
	Width  int64
	Height int64
}

type Environment

type Environment string
const (
	EnvironmentWindows Environment = "windows"
	EnvironmentMac     Environment = "mac"
	EnvironmentLinux   Environment = "linux"
	EnvironmentUbuntu  Environment = "ubuntu"
	EnvironmentBrowser Environment = "browser"
)

type Position

type Position struct {
	X int64
	Y int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL