events

package
v0.0.0-...-ad3cfc1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package events contains the basic primitives of the input and output events

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytesEvent

type BytesEvent string

BytesEvent holds all the unrecognized bytes from the input

func (BytesEvent) String

func (b BytesEvent) String() string

type ErrorEvent

type ErrorEvent string

ErrorEvent holds an error produce while processing the input

func (ErrorEvent) String

func (e ErrorEvent) String() string

type Event

type Event interface {
	String() string
}

Event holds the information of the event.

type KeyboardEvent

type KeyboardEvent struct {
	// Key Is the printibal character
	Key string
	// Ctrl is true if the Control key is pressed
	Ctrl bool
	// Alt is true if the Alt key is pressed
	Alt bool
	// Shift is true if the Shift key is pressed
	Shift bool
	// Code holds the name of the key. For example: Right, Escape or Enter
	Code string
}

KeyboardEvent represent a key press.

func (KeyboardEvent) String

func (ke KeyboardEvent) String() string

type MouseEvent

type MouseEvent struct {
	Row, Col int
	Button   int
	Action   string
}

MouseEvent represent any action related with the mouse

func (*MouseEvent) String

func (m *MouseEvent) String() string

type PasteEvent

type PasteEvent string

PasteEvent represent the intent of pasting content in the terminal

func (PasteEvent) String

func (p PasteEvent) String() string

type WindowSizeEvent

type WindowSizeEvent struct {
	Cols int
	Rows int
}

WindowSizeEvent represents the window terminal size in characters

func (*WindowSizeEvent) String

func (wse *WindowSizeEvent) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳