Documentation
¶
Index ¶
- type Controller
- func (c *Controller) CaptureScreen(ctx context.Context, region *display.Region) (image.Image, error)
- func (c *Controller) CaptureScreenBytes(ctx context.Context, region *display.Region) ([]byte, error)
- func (c *Controller) ClickMouse(ctx context.Context, button display.MouseButton, clicks int) error
- func (c *Controller) Close() error
- func (c *Controller) GetCursorPosition(ctx context.Context) (x, y int, err error)
- func (c *Controller) GetScreenDimensions(ctx context.Context) (width, height int, err error)
- func (c *Controller) MoveMouse(ctx context.Context, x, y int) error
- func (c *Controller) ScrollMouse(ctx context.Context, clicks int, direction string) error
- func (c *Controller) SendKeyCombo(ctx context.Context, combo string) error
- func (c *Controller) TypeText(ctx context.Context, text string, delayMs int) error
- type Provider
- type WaylandClient
- func (c *WaylandClient) CaptureScreenBytes(x, y, width, height int) ([]byte, error)
- func (c *WaylandClient) ClickMouse(button string, clicks int) error
- func (c *WaylandClient) Close()
- func (c *WaylandClient) GetScreenDimensions() (int, int, error)
- func (c *WaylandClient) MoveMouse(x, y int) error
- func (c *WaylandClient) ScrollMouse(clicks int, direction string) error
- func (c *WaylandClient) SendKeyCombo(combo string) error
- func (c *WaylandClient) TypeText(text string, delayMs int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller wraps the existing WaylandClient to implement the display.DisplayController interface
func (*Controller) CaptureScreen ¶
func (c *Controller) CaptureScreen(ctx context.Context, region *display.Region) (image.Image, error)
CaptureScreen captures a screenshot and returns an image.Image
func (*Controller) CaptureScreenBytes ¶
func (c *Controller) CaptureScreenBytes(ctx context.Context, region *display.Region) ([]byte, error)
CaptureScreenBytes captures a screenshot and returns PNG bytes
func (*Controller) ClickMouse ¶
func (c *Controller) ClickMouse(ctx context.Context, button display.MouseButton, clicks int) error
ClickMouse clicks the specified mouse button
func (*Controller) GetCursorPosition ¶
func (c *Controller) GetCursorPosition(ctx context.Context) (x, y int, err error)
GetCursorPosition returns the current cursor position Note: Wayland doesn't provide a standard way to get cursor position
func (*Controller) GetScreenDimensions ¶
func (c *Controller) GetScreenDimensions(ctx context.Context) (width, height int, err error)
GetScreenDimensions returns the screen width and height
func (*Controller) MoveMouse ¶
func (c *Controller) MoveMouse(ctx context.Context, x, y int) error
MoveMouse moves the cursor to the specified coordinates
func (*Controller) ScrollMouse ¶
ScrollMouse scrolls the mouse wheel
func (*Controller) SendKeyCombo ¶
func (c *Controller) SendKeyCombo(ctx context.Context, combo string) error
SendKeyCombo sends a key combination (e.g., "ctrl+c")
type Provider ¶
type Provider struct{}
Provider implements the display.Provider interface for Wayland
func (*Provider) GetController ¶
func (p *Provider) GetController() (display.DisplayController, error)
GetController creates a new DisplayController (auto-detects display from $WAYLAND_DISPLAY env var)
func (*Provider) GetDisplayInfo ¶
func (p *Provider) GetDisplayInfo() display.DisplayInfo
GetDisplayInfo returns information about the Wayland platform
func (*Provider) IsAvailable ¶
IsAvailable returns true if Wayland is available on the current system
type WaylandClient ¶
type WaylandClient struct {
// contains filtered or unexported fields
}
WaylandClient provides Wayland screen control operations using command-line tools
func NewWaylandClient ¶
func NewWaylandClient(display string) (*WaylandClient, error)
NewWaylandClient creates a new Wayland client
func (*WaylandClient) CaptureScreenBytes ¶
func (c *WaylandClient) CaptureScreenBytes(x, y, width, height int) ([]byte, error)
CaptureScreenBytes captures a screenshot and returns it as PNG bytes
func (*WaylandClient) ClickMouse ¶
func (c *WaylandClient) ClickMouse(button string, clicks int) error
ClickMouse performs a mouse click at the current cursor position
func (*WaylandClient) Close ¶
func (c *WaylandClient) Close()
Close closes the Wayland client (no-op for command-line tools)
func (*WaylandClient) GetScreenDimensions ¶
func (c *WaylandClient) GetScreenDimensions() (int, int, error)
GetScreenDimensions returns the screen width and height
func (*WaylandClient) MoveMouse ¶
func (c *WaylandClient) MoveMouse(x, y int) error
MoveMouse moves the cursor to the specified absolute coordinates
func (*WaylandClient) ScrollMouse ¶
func (c *WaylandClient) ScrollMouse(clicks int, direction string) error
ScrollMouse scrolls the mouse wheel
func (*WaylandClient) SendKeyCombo ¶
func (c *WaylandClient) SendKeyCombo(combo string) error
SendKeyCombo sends a key combination (e.g., "ctrl+c")