keyboard

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(ctx context.Context) <-chan Event

Types

type Event

type Event struct {
	Type   EventType
	Ch     rune
	Text   string
	Shift  bool
	Ctrl   bool
	Alt    bool
	Cmd    bool
	Mouse  bool
	MouseX int
	MouseY int
	Raw    []byte
}

type EventType

type EventType int
const (
	KeyRune EventType = iota
	KeyEnter
	KeyBackspace
	KeyCtrlC
	KeyTab
	KeyEscape
	KeyArrowUp
	KeyArrowDown
	KeyArrowRight
	KeyArrowLeft
	KeyHome
	KeyEnd
	KeyPageUp
	KeyPageDown
	KeyDelete
	KeyMouseWheelUp
	KeyMouseWheelDown
	KeyMouseLeftDown
	KeyMouseLeftDrag
	KeyMouseLeftUp
	KeyPaste
	KeyUnknown
)

Jump to

Keyboard shortcuts

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