keycode

package
v3.0.33 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabase

func NewDatabase(path, name string, cache *Cache) (*keycodedb, error)

func NewInputEvent

func NewInputEvent(name string, keycode gopi.KeyCode, evt *codec.CodecEvent) *event

Types

type Cache

type Cache struct {
	gopi.Unit
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Cache) DecodeFile

func (this *Cache) DecodeFile(path string) ([]*mapentry, error)

func (*Cache) DecodeLine

func (this *Cache) DecodeLine(line string) (*mapentry, error)

DecodeLine returns a *mapentry or nil if the line could not be decoded The line is <keycode> <scancode> <device> # comment separated by whitepace, where the comment is optional

func (*Cache) DeviceName

func (this *Cache) DeviceName(d gopi.InputDeviceType) string

func (*Cache) Dispose

func (this *Cache) Dispose() error

func (*Cache) EncodeFile

func (this *Cache) EncodeFile(path string, entries []*mapentry) error

func (*Cache) EncodeLine

func (this *Cache) EncodeLine(value *mapentry) string

func (*Cache) IndexDevice

func (this *Cache) IndexDevice()

func (*Cache) IndexKeycode

func (this *Cache) IndexKeycode()

func (*Cache) KeycodeName

func (this *Cache) KeycodeName(k gopi.KeyCode) string

func (*Cache) LookupDevice

func (this *Cache) LookupDevice(name string) gopi.InputDeviceType

func (*Cache) LookupKeycode

func (this *Cache) LookupKeycode(name string) gopi.KeyCode

func (*Cache) New

func (this *Cache) New(gopi.Config) error

func (*Cache) SearchKeycode

func (this *Cache) SearchKeycode(name string) []gopi.KeyCode

func (*Cache) String

func (this *Cache) String() string

type Manager

type Manager struct {
	gopi.Unit
	gopi.Publisher
	gopi.Logger
	sync.Mutex
	*Cache
	// contains filtered or unexported fields
}

func (*Manager) DatabaseForName

func (this *Manager) DatabaseForName(name string) (*keycodedb, error)

func (*Manager) Define

func (this *Manager) Define(cfg gopi.Config) error

func (*Manager) Dispose

func (this *Manager) Dispose() error

func (*Manager) Keycode

func (this *Manager) Keycode(name string) []gopi.KeyCode

Keycode returns keycodes which match a name

func (*Manager) Lookup

func (this *Manager) Lookup(device gopi.InputDevice, code uint32) []gopi.KeyCode

Lookup one or more keycodes for a device and scancode

func (*Manager) New

func (this *Manager) New(cfg gopi.Config) error

func (*Manager) Run

func (this *Manager) Run(ctx context.Context) error

func (*Manager) Set

func (this *Manager) Set(device gopi.InputDevice, code uint32, key gopi.KeyCode, name string) error

Set keycode for name,device and scancode

func (*Manager) String

func (this *Manager) String() string

Jump to

Keyboard shortcuts

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