darwininput

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package darwininput provides RobotGo's Pure-Go macOS input backend.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupported reports an operation unavailable through the Quartz backend.
	ErrUnsupported = errors.New("Pure-Go macOS input operation is unsupported")
	// ErrPermission reports missing macOS Accessibility permission.
	ErrPermission = errors.New("Pure-Go macOS input requires Accessibility permission")
	// ErrOwnership reports an attempt to release or overwrite foreign input state.
	ErrOwnership = errors.New("Pure-Go macOS input state is not owned by RobotGo")
)

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend serializes Quartz input transactions and tracks persistent holds.

func New

func New() *Backend

New creates a lazily initialized backend backed by macOS frameworks.

func (*Backend) Click

func (backend *Backend) Click(name string, double bool) error

Click injects one or two complete button pulses.

func (*Backend) Close

func (backend *Backend) Close() error

Close releases RobotGo-owned input and unloads the native frameworks.

func (*Backend) DragSmooth

func (backend *Backend) DragSmooth(x, y int, lowDelay, highDelay float64) error

DragSmooth owns the left button for the complete drag transaction.

func (*Backend) Key

func (backend *Backend) Key(event KeyEvent) error

Key injects one physical Quartz key transaction.

func (*Backend) KeyboardReady

func (backend *Backend) KeyboardReady() error

KeyboardReady checks the non-prompting Accessibility preflight and Quartz access.

func (*Backend) Location

func (backend *Backend) Location() (int, int, error)

Location returns the pointer location in global display coordinates.

func (*Backend) MouseReady

func (backend *Backend) MouseReady() error

MouseReady checks the non-prompting Accessibility preflight and Quartz access.

func (*Backend) MoveAbsolute

func (backend *Backend) MoveAbsolute(x, y int) error

MoveAbsolute moves the pointer in the CoreGraphics global coordinate space.

func (*Backend) MoveRelative

func (backend *Backend) MoveRelative(x, y int) error

MoveRelative moves from the current pointer location.

func (*Backend) MoveSmooth

func (backend *Backend) MoveSmooth(x, y int, relative bool, lowDelay, highDelay float64) error

MoveSmooth performs a bounded eased movement.

func (*Backend) Scroll

func (backend *Backend) Scroll(x, y int) error

Scroll injects horizontal and vertical pixel-based wheel deltas.

func (*Backend) Text

func (backend *Backend) Text(event TextEvent) error

Text injects exact UTF-16 strings through Quartz Unicode keyboard events.

func (*Backend) Toggle

func (backend *Backend) Toggle(name string, down bool) error

Toggle changes a persistent pointer-button state with ownership checks.

type KeyEvent

type KeyEvent struct {
	Key       string
	Modifiers []string
	PID       int
	Down      bool
	Tap       bool
}

KeyEvent is one normalized Quartz keyboard operation.

type TextEvent

type TextEvent struct {
	Text  string
	PID   int
	Delay time.Duration
}

TextEvent is one exact Unicode text operation.

Jump to

Keyboard shortcuts

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