keys

package
v2.0.0-alpha.45 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 4 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accelerator

type Accelerator struct {
	Key       string
	Modifiers []Modifier
}

Accelerator holds the keyboard shortcut for a menu item

func CmdOrCtrl

func CmdOrCtrl(key string) *Accelerator

CmdOrCtrl creates a 'CmdOrCtrl' Accelerator

func Combo

func Combo(key string, modifier1 Modifier, modifier2 Modifier, rest ...Modifier) *Accelerator

Combo creates an Accelerator with multiple Modifiers

func Control

func Control(key string) *Accelerator

Control creates a 'Control' Accelerator

func Key

func Key(key string) *Accelerator

Key creates a standard key Accelerator

func OptionOrAlt

func OptionOrAlt(key string) *Accelerator

OptionOrAlt creates a 'OptionOrAlt' Accelerator

func Parse

func Parse(shortcut string) (*Accelerator, error)

func Shift

func Shift(key string) *Accelerator

Shift creates a 'Shift' Accelerator

func Super

func Super(key string) *Accelerator

Super creates a 'Super' Accelerator

type Modifier

type Modifier string

Modifier is actually a string

const (
	// CmdOrCtrlKey represents Command on Mac and Control on other platforms
	CmdOrCtrlKey Modifier = "cmdorctrl"
	// OptionOrAltKey represents Option on Mac and Alt on other platforms
	OptionOrAltKey Modifier = "optionoralt"
	// ShiftKey represents the shift key on all systems
	ShiftKey Modifier = "shift"
	// SuperKey represents Command on Mac and the Windows key on the other platforms
	SuperKey Modifier = "super"
	// ControlKey represents the control key on all systems
	ControlKey Modifier = "ctrl"
)

Jump to

Keyboard shortcuts

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