input

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 4 Imported by: 0

README

native/input

English | 简体中文

Synthesize mouse and keyboard events: movement, click, and key press.

  • Dependencies: native (error value), native/internal/sys.
  • Used alone: Yes, no window required. Accessibility permissions are required except for reading the mouse position.
import "github.com/dyike/keel/native/input"

input.MouseMove(100, 200)
input.Click(input.Left)
input.Tap("enter")

For details, see Native capabilities · input.

Documentation

Overview

Package input synthesizes mouse and keyboard events. Everything except MousePosition needs the Accessibility permission.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Click

func Click(b Button) error

Click clicks at the current mouse position.

func KeyDown

func KeyDown(key string) error

KeyDown and KeyUp take US-layout key names such as "a", "enter", "f5", "cmd".

func KeyUp

func KeyUp(key string) error

func MouseMove

func MouseMove(x, y float64) error

func MousePosition

func MousePosition() (x, y float64, err error)

MousePosition uses the same coordinates as screen.Display.

func Tap

func Tap(key string) error

Tap presses and releases a key.

Types

type Button

type Button int
const (
	Left Button = iota
	Right
	Middle
)

Jump to

Keyboard shortcuts

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