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 X11Client
- func (c *X11Client) CaptureScreen(x, y, width, height int) (image.Image, error)
- func (c *X11Client) CaptureScreenBytes(x, y, width, height int) ([]byte, error)
- func (c *X11Client) ClickMouse(button string, clicks int) error
- func (c *X11Client) Close()
- func (c *X11Client) GetCursorPosition() (int, int, error)
- func (c *X11Client) GetScreenDimensions() (int, int)
- func (c *X11Client) MoveMouse(x, y int) error
- func (c *X11Client) ScrollMouse(clicks int, direction string) error
- func (c *X11Client) SendKeyCombo(combo string) error
- func (c *X11Client) 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 X11Client 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
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", "super+l")
type Provider ¶
type Provider struct{}
Provider implements the display.Provider interface for X11
func (*Provider) GetController ¶
func (p *Provider) GetController() (display.DisplayController, error)
GetController creates a new DisplayController (auto-detects display from $DISPLAY env var)
func (*Provider) GetDisplayInfo ¶
func (p *Provider) GetDisplayInfo() display.DisplayInfo
GetDisplayInfo returns information about the X11 platform
func (*Provider) IsAvailable ¶
IsAvailable returns true if X11 is available on the current system
type X11Client ¶
type X11Client struct {
// contains filtered or unexported fields
}
X11Client wraps X11 connection and provides screen control operations
func NewX11Client ¶
NewX11Client creates a new X11 client connection
func (*X11Client) CaptureScreen ¶
CaptureScreen captures a screenshot of the entire screen or a region
func (*X11Client) CaptureScreenBytes ¶
CaptureScreenBytes captures a screenshot and returns it as PNG bytes
func (*X11Client) ClickMouse ¶
ClickMouse performs a mouse click at the current cursor position
func (*X11Client) GetCursorPosition ¶
GetCursorPosition returns the current cursor position
func (*X11Client) GetScreenDimensions ¶
GetScreenDimensions returns the screen width and height
func (*X11Client) ScrollMouse ¶
ScrollMouse scrolls the mouse wheel For X11: button 4 = scroll up, button 5 = scroll down
button 6 = scroll left, button 7 = scroll right
func (*X11Client) SendKeyCombo ¶
SendKeyCombo sends a key combination (e.g., "ctrl+c", "super+l")