input

package
v0.210929.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: CC0-1.0 Imports: 9 Imported by: 0

Documentation

Overview

Abstract input events

Index

Constants

View Source
const (
	EvendKeyAccept    types.InputKey = 13
	EvendKeyReject    types.InputKey = 27
	EvendKeyCreamLess types.InputKey = 'A'
	EvendKeyCreamMore types.InputKey = 'B'
	EvendKeySugarLess types.InputKey = 'C'
	EvendKeySugarMore types.InputKey = 'D'

	EvendKeyDot types.InputKey = '.'
)
View Source
const DevInputEventTag = "dev-input-event"
View Source
const EvendKeyMaskUp = 0x80
View Source
const EvendKeyboardSourceTag = "evend-keyboard"
View Source
const (
	MoneyKeyAbort types.InputKey = 27
)
View Source
const MoneySourceTag = "money"

Variables

This section is empty.

Functions

func Drain

func Drain(ch <-chan types.InputEvent)

func IsAccept

func IsAccept(e *types.InputEvent) bool

func IsMoneyAbort

func IsMoneyAbort(e *types.InputEvent) bool

func IsReject

func IsReject(e *types.InputEvent) bool

Types

type DevInputEventSource

type DevInputEventSource struct {
	// contains filtered or unexported fields
}

func NewDevInputEventSource

func NewDevInputEventSource(device string) (*DevInputEventSource, error)

func (*DevInputEventSource) Read

func (self *DevInputEventSource) Read() (types.InputEvent, error)

func (*DevInputEventSource) String

func (self *DevInputEventSource) String() string

type Dispatch

type Dispatch struct {
	Log *log2.Log
	// contains filtered or unexported fields
}

func NewDispatch

func NewDispatch(log *log2.Log, stop <-chan struct{}) *Dispatch

func (*Dispatch) Emit

func (self *Dispatch) Emit(event types.InputEvent)

func (*Dispatch) Enable

func (self *Dispatch) Enable(e bool)

func (*Dispatch) Run

func (self *Dispatch) Run(sources []Source)

func (*Dispatch) SubscribeChan

func (self *Dispatch) SubscribeChan(name string, substop <-chan struct{}) chan types.InputEvent

func (*Dispatch) SubscribeFunc

func (self *Dispatch) SubscribeFunc(name string, fun EventFunc, substop <-chan struct{})

func (*Dispatch) Unsubscribe

func (self *Dispatch) Unsubscribe(name string)

type EvendKeyboard

type EvendKeyboard struct {
	// contains filtered or unexported fields
}

func NewEvendKeyboard

func NewEvendKeyboard(client *mega.Client) (*EvendKeyboard, error)

func (*EvendKeyboard) Close

func (self *EvendKeyboard) Close() error

func (*EvendKeyboard) Read

func (self *EvendKeyboard) Read() (types.InputEvent, error)

func (*EvendKeyboard) String

func (self *EvendKeyboard) String() string

type EventFunc

type EventFunc func(types.InputEvent)

type Source

type Source interface {
	Read() (types.InputEvent, error)
	String() string
}

Jump to

Keyboard shortcuts

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