keys

package
v2.0.0-alpha.24 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: MIT Imports: 0 Imported by: 14

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 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 = "Control"
)

Jump to

Keyboard shortcuts

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