bus

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	// KeyPress represents a keyboard key press event
	KeyPress *KeyPressEvent
	// MouseClick represents a mouse click event
	MouseClick *MouseClickEvent
	// WindowFocus represents a window focus change event
	WindowFocus *WindowFocusEvent
}

Event represents any type of event that can trigger an action

type Impl

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

Impl processes events

func New

func New(script string, windowInfo wininfo.WinGetter, out *golibevdev.UInputDev) (*Impl, error)

New creates a new bus implementation

func (*Impl) GetActiveWindowClass

func (m *Impl) GetActiveWindowClass() string

func (*Impl) ProcessEvent

func (m *Impl) ProcessEvent(event *Event) (bool, error)

ProcessEvent processes an event through the current bus

func (*Impl) SendKeys

func (m *Impl) SendKeys(keyCodes []keys.Key)

func (*Impl) SetBeforeSendKeysPerSession

func (m *Impl) SetBeforeSendKeysPerSession(fn func())

type KeyPressEvent

type KeyPressEvent struct {
	Keys     []golibevdev.KeyEventCode
	Pressed  bool // true for press, false for release
	Repeated bool // true if key repeat
}

KeyPressEvent represents a keyboard key press

type MouseClickEvent

type MouseClickEvent struct {
	X       float64
	Y       float64
	Button  int
	Pressed bool // true for press, false for release
}

MouseClickEvent represents a mouse click

type WindowFocusEvent

type WindowFocusEvent struct {
	Window *wininfo.WinInfo
}

WindowFocusEvent represents a window focus change

Jump to

Keyboard shortcuts

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