keyboard

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package keyboard interprets Wayland evdev key events on the UI loop.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	Physical        uint32
	Logical         uint32
	Name, Text      string
	Pressed, Repeat bool
	Shift, Ctrl     bool
	Group           uint32
}

type Keyboard

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

func New

func New(locale string) (*Keyboard, error)

func (*Keyboard) Close

func (k *Keyboard) Close()

func (*Keyboard) Event

func (k *Keyboard) Event(evdev uint32, pressed bool, now time.Time) (Key, error)

func (*Keyboard) Focus

func (k *Keyboard) Focus(on bool)

func (*Keyboard) Mask

func (k *Keyboard) Mask(depressed, latched, locked, groupDepressed, groupLatched, groupLocked uint32) error

func (*Keyboard) NextRepeat

func (k *Keyboard) NextRepeat() (time.Time, bool)

func (*Keyboard) RepeatInfo

func (k *Keyboard) RepeatInfo(rate int, delay time.Duration)

func (*Keyboard) ReplaceFD

func (k *Keyboard) ReplaceFD(fd, size int) error

ReplaceFD consumes the received FD even on failure; the previous keymap remains valid on failure.

func (*Keyboard) Rules

func (k *Keyboard) Rules(layout, options string) error

func (*Keyboard) Tick

func (k *Keyboard) Tick(now time.Time) (Key, bool)

Tick returns at most one repeat for a due deadline, without accumulating missed ticks. It resolves the held physical key against the current modifier/group mask. Compose is fed only by physical presses: synthetic repeats neither advance a compose sequence nor replay the press-time composed text.

Jump to

Keyboard shortcuts

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