evdev

package
v0.0.0-...-6af99f7 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

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

Device represents an evdev input device.

type Handler

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

Handler manages evdev input devices.

func NewHandler

func NewHandler() *Handler

NewHandler creates a new evdev input handler.

func (*Handler) Close

func (h *Handler) Close() error

Close closes all devices.

func (*Handler) Devices

func (h *Handler) Devices() []string

Devices returns information about opened devices.

func (*Handler) Events

func (h *Handler) Events() <-chan graphics.Event

Events returns the event channel.

func (*Handler) MousePosition

func (h *Handler) MousePosition() (x, y int)

MousePosition returns the current mouse position.

func (*Handler) Open

func (h *Handler) Open() error

Open scans for and opens input devices.

func (*Handler) Poll

func (h *Handler) Poll() *graphics.Event

Poll returns the next event or nil if none available.

func (*Handler) SetLayout

func (h *Handler) SetLayout(layout KeyboardLayout)

SetLayout sets the keyboard layout.

func (*Handler) SetScreenSize

func (h *Handler) SetScreenSize(width, height int)

SetScreenSize sets the screen size for mouse bounds.

func (*Handler) Start

func (h *Handler) Start()

Start begins reading events from all devices.

func (*Handler) Stop

func (h *Handler) Stop()

Stop stops reading events.

func (*Handler) Wait

func (h *Handler) Wait(timeout time.Duration) *graphics.Event

Wait waits for the next event with a timeout.

type KeyboardLayout

type KeyboardLayout string

KeyboardLayout represents a keyboard layout.

const (
	LayoutUS KeyboardLayout = "us"
	LayoutUK KeyboardLayout = "uk"
	LayoutDE KeyboardLayout = "de"
)

Jump to

Keyboard shortcuts

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