Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DisplayController ¶
type DisplayController interface {
// Screen operations
CaptureScreenBytes(ctx context.Context, region *Region) ([]byte, error)
CaptureScreen(ctx context.Context, region *Region) (image.Image, error)
GetScreenDimensions(ctx context.Context) (width, height int, err error)
// Mouse operations
GetCursorPosition(ctx context.Context) (x, y int, err error)
MoveMouse(ctx context.Context, x, y int) error
ClickMouse(ctx context.Context, button MouseButton, clicks int) error
ScrollMouse(ctx context.Context, clicks int, direction string) error
// Keyboard operations
TypeText(ctx context.Context, text string, delayMs int) error
SendKeyCombo(ctx context.Context, combo string) error
// Lifecycle
Close() error
}
DisplayController abstracts the desktop input and screen-capture operations.
type DisplayInfo ¶
type DisplayInfo struct {
Name string
}
DisplayInfo contains metadata about the display backend
type MouseButton ¶
type MouseButton int
MouseButton represents a mouse button
const ( MouseButtonLeft MouseButton = iota MouseButtonMiddle MouseButtonRight )
func ParseMouseButton ¶
func ParseMouseButton(s string) MouseButton
ParseMouseButton parses a string into a MouseButton
func (MouseButton) String ¶
func (b MouseButton) String() string
String returns the string representation of a mouse button
type Provider ¶
type Provider interface {
GetController() (DisplayController, error)
GetDisplayInfo() DisplayInfo
IsAvailable() bool
}
Provider creates DisplayController instances.
func DetectDisplay ¶
DetectDisplay returns the display provider when it is available.
type RobotProvider ¶
type RobotProvider struct{}
RobotProvider implements the display.Provider interface on robotgo.
func (*RobotProvider) GetController ¶
func (p *RobotProvider) GetController() (DisplayController, error)
func (*RobotProvider) GetDisplayInfo ¶
func (p *RobotProvider) GetDisplayInfo() DisplayInfo
func (*RobotProvider) IsAvailable ¶
func (p *RobotProvider) IsAvailable() bool
Click to show internal directories.
Click to hide internal directories.