xinput

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commander

type Commander interface {
	Command(name string, arg ...string)
	Output() ([]byte, error)
}

func NewExecCommander

func NewExecCommander() Commander

type DeviceRole

type DeviceRole string
const (
	Primary   DeviceRole = "master"
	Secondary DeviceRole = "slave"
)

type DeviceType

type DeviceType string
const (
	Keyboard DeviceType = "keyboard"
	Pointer  DeviceType = "pointer"
)

type ExecCommander

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

func (*ExecCommander) Command

func (e *ExecCommander) Command(name string, arg ...string)

func (*ExecCommander) Output

func (e *ExecCommander) Output() ([]byte, error)

type Handler

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

func NewHandler

func NewHandler() (Handler, error)

func (*Handler) CreatePrimary

func (h *Handler) CreatePrimary(name string) (Xinput, Xinput, error)

func (*Handler) DetectNewPrimaries

func (h *Handler) DetectNewPrimaries() ([]Xinput, error)

func (*Handler) DetectNewSecondaries

func (h *Handler) DetectNewSecondaries(dType DeviceType) ([]Xinput, error)

func (*Handler) GetPrimaries

func (h *Handler) GetPrimaries() []Xinput

func (*Handler) GetPrimariesByName

func (h *Handler) GetPrimariesByName(name string) (Xinput, Xinput, error)

func (*Handler) GetState

func (h *Handler) GetState() map[int]Xinput

for Debugging

func (*Handler) Reattach

func (h *Handler) Reattach(inputs []Xinput, primaryID int) error

func (*Handler) RemovePrimary

func (h *Handler) RemovePrimary(id int) error

func (*Handler) UpdateState

func (h *Handler) UpdateState() error

type Xinput

type Xinput struct {
	Name      string
	ID        int
	Type      DeviceType
	Role      DeviceRole
	PrimaryID int
}

Jump to

Keyboard shortcuts

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