uinput

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package uinput creates virtual input devices through /dev/uinput.

Index

Constants

View Source
const DevicePath = "/dev/uinput"

DevicePath is the uinput node.

View Source
const FFEffectsMax = 16

FFEffectsMax is how many force-feedback effects a device holds at once.

View Source
const PropDirect = 0x01

Input properties.

Variables

This section is empty.

Functions

func Available

func Available() error

Available reports whether DevicePath can be opened for writing.

Types

type AbsAxis

type AbsAxis struct {
	Code       uint16
	Min, Max   int32
	Fuzz, Flat int32
	Resolution int32
}

AbsAxis is one absolute axis of a device.

type Config

type Config struct {
	Name                 string
	Bus, Vendor, Product uint16
	Version              uint16
	Keys                 []uint16
	Rels                 []uint16
	Abs                  []AbsAxis
	Props                []uint16
	// Rumble gives the device force feedback of type FF_RUMBLE.
	Rumble bool
}

Config describes a device to create.

type Device

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

Device is a created virtual device. Emit and Close are safe from any goroutine.

func Create

func Create(cfg Config, onRumble RumbleFunc) (*Device, error)

Create makes the device. onRumble may be nil; it is called from a goroutine of the device's own.

func (*Device) Close

func (d *Device) Close() error

Close destroys the device.

func (*Device) Emit

func (d *Device) Emit(evs ...evdev.Event) error

Emit writes evs followed by a SYN_REPORT in one write, so a reader sees them as one frame.

type RumbleFunc

type RumbleFunc func(strong, weak uint16)

RumbleFunc receives a game's rumble on the device, strengths 0..65535; both zero stops it.

Jump to

Keyboard shortcuts

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