mouse

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const MaxCoordinate = 65535

Variables

View Source
var ReportDesc = []byte{
	0x05, 0x01,
	0x09, 0x02,
	0xa1, 0x01,
	0x09, 0x01,
	0xa1, 0x00,
	0x05, 0x09,

	0x19, 0x01,
	0x29, 0x03,
	0x15, 0x00,
	0x25, 0x01,
	0x95, 0x03,
	0x75, 0x01,
	0x81, 0x02,

	0x95, 0x01,
	0x75, 0x05,
	0x81, 0x03,
	0x05, 0x01,

	0x09, 0x30,
	0x09, 0x31,
	0x15, 0x00,
	0x26, 0xFF, 0x7F,
	0x75, 0x10,
	0x95, 0x02,
	0x81, 0x02,

	0x09, 0x38,
	0x15, 0x81,
	0x25, 0x7f,
	0x75, 0x08,
	0x95, 0x01,
	0x81, 0x06,
	0xc0,
	0xc0,
}

Functions

This section is empty.

Types

type Button

type Button uint8
const (
	Left Button = iota
	Center
	Right
)

type Mouse

type Mouse interface {
	Move(x int, y int)
	MoveFloat(x float32, y float32)

	Scroll(x int, y int)

	MouseDown(button Button)
	MouseUp(button Button)

	Update()
}

func CreateDummy

func CreateDummy() (Mouse, error)

type MouseImpl

type MouseImpl struct {
	*uinput.Device
}

func Create

func Create() (*MouseImpl, error)

func (*MouseImpl) MouseDown

func (m *MouseImpl) MouseDown(button Button)

func (*MouseImpl) MouseUp

func (m *MouseImpl) MouseUp(button Button)

func (*MouseImpl) Move

func (m *MouseImpl) Move(x int, y int)

func (*MouseImpl) MoveFloat

func (m *MouseImpl) MoveFloat(x float32, y float32)

func (*MouseImpl) Scroll

func (m *MouseImpl) Scroll(x int, y int)

func (*MouseImpl) Update

func (m *MouseImpl) Update()

Jump to

Keyboard shortcuts

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