gokeyboard

package module
v0.0.0-...-f1ee03b Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRoot

func IsRoot() bool

Will check if the program runs as root

Types

type Key

type Key struct {
	Type   uint16
	Code   uint16
	Status int32
	// contains filtered or unexported fields
}

Will represent a key, will be able to get the code and the string value from it. By default 2 keys are written, one when the key pressed, and one when released, therefore make sure to check the status with IsPressed or IsReleased

func (*Key) IsBackSpace

func (key *Key) IsBackSpace() bool

func (*Key) IsPressed

func (key *Key) IsPressed() bool

func (*Key) IsReleased

func (key *Key) IsReleased() bool

func (*Key) IsShift

func (key *Key) IsShift() bool

Will check if the key is shift, for easy case handling

func (*Key) ToString

func (key *Key) ToString() string

Will return the key string value, if does not exists will return empty string.

type KeyboardFile

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

func New

func New(keyboardFilePath string) (*KeyboardFile, error)

Will create a new Keyboard listener

func (*KeyboardFile) Close

func (k *KeyboardFile) Close() error

func (*KeyboardFile) Read

func (k *KeyboardFile) Read() chan Key

Will return a stream of Keys.

Jump to

Keyboard shortcuts

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