linuxinput

package
v2.6.0-beta12 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeviceName     = "Zaparoo"
	DefaultTimeout = 40 * time.Millisecond
)

Variables

Functions

func ToGamepadCode

func ToGamepadCode(name string) (int, bool)

ToGamepadCode converts a single ZapScript button symbol to a uinput code.

func ToKeyboardCode

func ToKeyboardCode(name string) (int, bool)

ToKeyboardCode converts a single ZapScript key symbol to a uinput code.

Types

type Gamepad

type Gamepad struct {
	Device uinput.Gamepad
	Delay  time.Duration
}

func NewGamepad

func NewGamepad(delay time.Duration) (Gamepad, error)

NewGamepad returns a uinput virtual gamepad device. It takes a delay duration which is used between presses to avoid overloading the OS or user applications. This device must be closed when the service stops.

func (*Gamepad) Close

func (k *Gamepad) Close() error

func (*Gamepad) Combo

func (k *Gamepad) Combo(keys ...int) error

func (*Gamepad) Press

func (k *Gamepad) Press(key int) error

type Keyboard

type Keyboard struct {
	Device uinput.Keyboard
	Delay  time.Duration
}

func NewKeyboard

func NewKeyboard(delay time.Duration) (Keyboard, error)

NewKeyboard returns a uinput virtual keyboard device. It takes a delay duration which is used between presses to avoid overloading the OS or user applications. This device must be closed when the service stops.

func (*Keyboard) Close

func (k *Keyboard) Close() error

func (*Keyboard) Combo

func (k *Keyboard) Combo(keys ...int) error

func (*Keyboard) Press

func (k *Keyboard) Press(key int) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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