desktop

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: BSD-3-Clause Imports: 3 Imported by: 57

Documentation

Index

Constants

View Source
const (
	// KeyShiftLeft represents the left shift key
	KeyShiftLeft fyne.KeyName = "LeftShift"
	// KeyShiftRight represents the right shift key
	KeyShiftRight fyne.KeyName = "RightShift"
	// KeyControlLeft represents the left control key
	KeyControlLeft fyne.KeyName = "LeftControl"
	// KeyControlRight represents the right control key
	KeyControlRight fyne.KeyName = "RightControl"
	// KeyAltLeft represents the left alt key
	KeyAltLeft fyne.KeyName = "LeftAlt"
	// KeyAltRight represents the right alt key
	KeyAltRight fyne.KeyName = "RightAlt"
	// KeySuperLeft represents the left "Windows" key (or "Command" key on macOS)
	KeySuperLeft fyne.KeyName = "LeftSuper"
	// KeySuperRight represents the right "Windows" key (or "Command" key on macOS)
	KeySuperRight fyne.KeyName = "RightSuper"
	// KeyMenu represents the left or right menu / application key
	KeyMenu fyne.KeyName = "Menu"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas interface {
	OnKeyDown() func(*fyne.KeyEvent)
	SetOnKeyDown(func(*fyne.KeyEvent))
	OnKeyUp() func(*fyne.KeyEvent)
	SetOnKeyUp(func(*fyne.KeyEvent))
}

Canvas defines the desktop specific extensions to a fyne.Canvas.

type CustomShortcut

type CustomShortcut struct {
	fyne.KeyName
	Modifier
}

CustomShortcut describes a shortcut desktop event.

func (*CustomShortcut) ShortcutName

func (cs *CustomShortcut) ShortcutName() string

ShortcutName returns the shortcut name associated to the event

type Hoverable added in v1.1.0

type Hoverable interface {
	MouseIn(*MouseEvent)
	MouseOut()
	MouseMoved(*MouseEvent)
}

Hoverable is used when a canvas object wishes to know if a pointer device moves over it.

type Keyable

type Keyable interface {
	fyne.Focusable

	KeyDown(*fyne.KeyEvent)
	KeyUp(*fyne.KeyEvent)
}

Keyable describes any focusable canvas object that can accept desktop key events. This is the traditional key down and up event that is not applicable to all devices.

type Modifier

type Modifier int

Modifier captures any key modifiers (shift etc) pressed during this key event

const (
	// ShiftModifier represents a shift key being held
	ShiftModifier Modifier = 1 << iota
	// ControlModifier represents the ctrl key being held
	ControlModifier
	// AltModifier represents either alt keys being held
	AltModifier
	// SuperModifier represents either super keys being held
	SuperModifier
)

type MouseButton

type MouseButton int

MouseButton represents a single button in a desktop MouseEvent

const (
	// LeftMouseButton is the most common mouse button - on some systems the only one
	LeftMouseButton MouseButton = iota + 1

	// RightMouseButton is the secondary button on most mouse input devices.
	RightMouseButton
)

type MouseEvent

type MouseEvent struct {
	fyne.PointEvent
	Button   MouseButton
	Modifier Modifier
}

MouseEvent contains data relating to desktop mouse events

type Mouseable

type Mouseable interface {
	MouseDown(*MouseEvent)
	MouseUp(*MouseEvent)
}

Mouseable represents desktop mouse events that can be sent to CanvasObjects

Jump to

Keyboard shortcuts

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