utils

package
v0.0.0-...-17244d7 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DevTypeUnknown int32 = iota
	DevTypeKeyboard
	DevTypeMouse
	DevTypeTouchpad
	DevTypeWacom
	DevTypeTouchscreen
)

Variables

This section is empty.

Functions

func CanLeftHanded

func CanLeftHanded(xid uint32, devName string) bool

func GetButtonMap

func GetButtonMap(xid uint32, devName string) ([]byte, error)

func GetProperty

func GetProperty(id int32, prop string) ([]byte, int32)

func IsPropertyExist

func IsPropertyExist(id int32, prop string) bool

func QueryDeviceType

func QueryDeviceType(id int32) int32

func ReadFloat32

func ReadFloat32(datas []byte, nitems int32) []float32

func ReadInt16

func ReadInt16(datas []byte, nitems int32) []int16

func ReadInt32

func ReadInt32(datas []byte, nitems int32) []int32

func ReadInt8

func ReadInt8(datas []byte, nitems int32) []int8

func SetButtonMap

func SetButtonMap(xid uint32, devName string, btnMap []byte) error

func SetFloat32Prop

func SetFloat32Prop(id int32, prop string, values []float32) error

func SetInt16Prop

func SetInt16Prop(id int32, prop string, values []int16) error

func SetInt32Prop

func SetInt32Prop(id int32, prop string, values []int32) error

func SetInt8Prop

func SetInt8Prop(id int32, prop string, values []int8) error

func SetKeyboardRepeat

func SetKeyboardRepeat(enabled bool, delay, interval uint32) error

func SetLeftHanded

func SetLeftHanded(xid uint32, devName string, useLeft bool) error

func WriteFloat32

func WriteFloat32(values []float32) []byte

func WriteInt16

func WriteInt16(values []int16) []byte

func WriteInt32

func WriteInt32(values []int32) []byte

func WriteInt8

func WriteInt8(values []int8) []byte

Types

type DeviceInfo

type DeviceInfo struct {
	Id      int32
	Type    int32
	Name    string
	Enabled bool
}

type DeviceInfos

type DeviceInfos []*DeviceInfo

func ListDevice

func ListDevice() DeviceInfos

func (DeviceInfos) Get

func (infos DeviceInfos) Get(id int32) *DeviceInfo

Jump to

Keyboard shortcuts

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