windowsinput

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package windowsinput provides RobotGo's Pure-Go Windows input backend.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupported reports an operation that Win32 cannot safely provide.
	ErrUnsupported = errors.New("Pure-Go Windows input operation is unsupported")
	// ErrOwnership reports an attempt to release or overwrite foreign input.
	ErrOwnership = errors.New("Pure-Go Windows 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 Win32 input transactions and tracks persistent holds.

func New

func New() *Backend

New creates a backend backed by user32.dll.

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 every key, Unicode unit, and button still owned by RobotGo.

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 foreground-layout-aware key transaction.

func (*Backend) KeyboardReady

func (backend *Backend) KeyboardReady() error

KeyboardReady verifies that the required Win32 keyboard entry points exist.

func (*Backend) Location

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

Location returns the pointer location in virtual-screen coordinates.

func (*Backend) MouseReady

func (backend *Backend) MouseReady() error

MouseReady verifies the pointer entry points and access to the input desktop.

func (*Backend) MoveAbsolute

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

MoveAbsolute moves the pointer in virtual-screen coordinates.

func (*Backend) MoveRelative

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

MoveRelative moves from the current pointer location without acceleration.

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 wheel deltas.

func (*Backend) Text

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

Text injects exact UTF-16 code units through KEYEVENTF_UNICODE.

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 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