event

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: BSD-2-Clause Imports: 0 Imported by: 2

Documentation

Overview

Package event hides the retrieval of events from different sources

Index

Constants

This section is empty.

Variables

View Source
var EventChan chan Event

EventChan is a global reference to the channel

Functions

func Write added in v0.6.0

func Write(event Event)

Write writes an event to the channel

Types

type Event

type Event struct {
	Type   Type
	Width  int
	Height int
}

Event is one of the earlier list of Event constants and also contains a position

func Read added in v0.6.0

func Read() Event

Read reads an event from the channel

type Type added in v0.6.0

type Type uint8

Type represents an event type

const (
	EventNone               Type = iota // no event was given
	EventAnonymise                      // toggle anonymising data.
	EventFinished                       // please exit the program
	EventViewNext                       // show me the next view
	EventViewPrev                       // show me the previous view
	EventDecreasePollTime               // reduce the poll time (if possible)
	EventIncreasePollTime               // increase the poll time
	EventHelp                           // provide me with help
	EventToggleWantRelative             // toggle between wanting absolute or relative stats
	EventResetStatistics                // reset the current stats back to zero
	EventResizeScreen                   // not really a event but a state change
	EventUnknown                        // something weird has happened
	EventError                          // some error
)

Event* hold the different event types as integer values

Jump to

Keyboard shortcuts

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