desktop

package
v1.4.3 Latest Latest
Warning

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

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

Documentation

Overview

Package desktop provides desktop specific driver functionality.

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"
	// KeyPrintScreen represents the key used to cause a screen capture
	KeyPrintScreen fyne.KeyName = "PrintScreen"

	// KeyCapsLock represents the caps lock key, tapping once is the down event then again is the up
	KeyCapsLock fyne.KeyName = "CapsLock"
)

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 Cursor added in v1.3.0

type Cursor int

Cursor represents a standard fyne cursor

const (
	// DefaultCursor is the default cursor typically an arrow
	DefaultCursor Cursor = iota
	// TextCursor is the cursor often used to indicate text selection
	TextCursor
	// CrosshairCursor is the cursor often used to indicate bitmaps
	CrosshairCursor
	// PointerCursor is the cursor often used to indicate a link
	PointerCursor
	// HResizeCursor is the cursor often used to indicate horizontal resize
	HResizeCursor
	// VResizeCursor is the cursor often used to indicate vertical resize
	VResizeCursor
)

type Cursorable added in v1.3.0

type Cursorable interface {
	Cursor() Cursor
}

Cursorable describes any CanvasObject that needs a cursor change

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 Driver added in v1.3.0

type Driver interface {
	// Create a new borderless window that is centered on screen
	CreateSplashWindow() fyne.Window
}

Driver represents the extended capabilities of a desktop driver

type Hoverable added in v1.1.0

type Hoverable interface {
	// MouseIn is a hook that is called if the mouse pointer enters the element.
	MouseIn(*MouseEvent)
	// MouseMoved is a hook that is called if the mouse pointer moved over the element.
	MouseMoved(*MouseEvent)
	// MouseOut is a hook that is called if the mouse pointer leaves the element.
	MouseOut()
}

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 = 1 << iota

	// 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