key

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package key represents keys on the keyboard that the user might type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringToKeys

func StringToKeys(s string) iter.Seq[Key]

StringToKeys returns a sequence of Key

Types

type Key

type Key struct {
	Letter string
	// contains filtered or unexported fields
}

Key represents a single keyboard input. WARNING: This is experimental.

This is currently a simple abstraction, not taking the sequence of modifier keys into consideration. E.g., shift+A would result in keydown (shift), keydown (A with modifer shift: true), keyup (A), and keyup (shift).

This general sequence of events is not yet properly representable in the types.

func RuneToKey

func RuneToKey(r rune) Key

RuneToKey returns a Key representing the keyboard key with the letter specified.

Jump to

Keyboard shortcuts

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