gamepad

package
v0.0.0-...-1e218f7 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	OriginalId int
	Id         int
	KObj       string
	Env        map[string]string
	Major      int16
	Minor      int16
	DevPath    string
	// contains filtered or unexported fields
}

func (*Device) Close

func (d *Device) Close() error

func (*Device) EmitUDevEvent

func (d *Device) EmitUDevEvent(action netlink.KObjAction) error

func (*Device) GetSysPath

func (d *Device) GetSysPath() string

func (*Device) GetUDevDBPath

func (d *Device) GetUDevDBPath() string

func (*Device) Initialize

func (d *Device) Initialize(udev *udev.UDev)

* This function should be called after all of the public properties of the device have been set.

func (*Device) MakeDeviceNode

func (d *Device) MakeDeviceNode()

func (*Device) WriteUDevDatabaseData

func (d *Device) WriteUDevDatabaseData()

type GamepadBitfield

type GamepadBitfield struct {
	// Button 1
	ButtonNorth,
	ButtonSouth,
	ButtonWest,
	ButtonEast,

	ButtonBumperLeft,
	ButtonBumperRight,
	ButtonThumbLeft,
	ButtonThumbRight,

	ButtonSelect,
	ButtonStart,

	ButtonDpadUp,
	ButtonDpadDown,
	ButtonDpadLeft,
	ButtonDpadRight,

	ButtonMode bool

	// Axis 1
	AxisLeftX,
	AxisLeftY,

	AxisRightX,
	AxisRightY,

	AxisLeftTrigger,
	AxisRightTrigger float32
}

func (*GamepadBitfield) ToString

func (b *GamepadBitfield) ToString() string

func (*GamepadBitfield) UnmarshalBinary

func (b *GamepadBitfield) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

type VirtualGamepad

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

func CreateVirtualGamepad

func CreateVirtualGamepad(udev *udev.UDev, gamepadId int, vendorId int16, productId int16) (*VirtualGamepad, error)

func (*VirtualGamepad) Close

func (pad *VirtualGamepad) Close() error

func (*VirtualGamepad) SendInput

func (pad *VirtualGamepad) SendInput(state GamepadBitfield)

Jump to

Keyboard shortcuts

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