input

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyDevice = errors.New("device has no gamepads")
View Source
var ErrInvalidViiperServer = errors.New("invalid VIIPER server")
View Source
var ErrNoDeviceForID = errors.New("no device found for given id")
View Source
var ErrUnsupportedViiperVersion = errors.New("unsupported VIIPER version")
View Source
var ErrVirtualAlreadyAssigned = errors.New("virtual gamepad already assigned to a real gamepad")
View Source
var ErrVirtualWithoutRealGamepad = errors.New("virtual gamepad without real gamepad")

Functions

This section is empty.

Types

type Device

type Device struct {
	RealGamepad         *sdl.Gamepad
	SteamVirtualGamepad *sdl.Gamepad
	ViiperDevice        *viiperdevice.Device
	// contains filtered or unexported fields
}

func (*Device) Close

func (d *Device) Close()

func (*Device) Gamepad

func (d *Device) Gamepad(id sdl.GamepadID) (gp *sdl.Gamepad, isVirtual bool, err error)

func (*Device) Lock

func (d *Device) Lock()

func (*Device) SetViiperDevice

func (d *Device) SetViiperDevice(vd *viiperdevice.Device)

func (*Device) Unlock

func (d *Device) Unlock()

type DeviceStore

type DeviceStore interface {
	OpenGamePad(id sdl.GamepadID) (*Device, error)
	CloseGamePad(id sdl.GamepadID) error
	DeviceForID(id sdl.GamepadID) (*Device, bool)
	IgnoreNextDevice(num int)
	Empty() bool
	Devices() []*Device
}

func NewDeviceStore

func NewDeviceStore(noSteamMode bool, gyroPassthrough bool) (DeviceStore, func(), error)

type ViiperBridge

type ViiperBridge interface {
	CreateDevice(ctx context.Context, gamepadID sdl.GamepadID, deviceType string) (chan *viiperdevice.Device, chan error)
	IsCreateDeviceScheduled(gamepadID sdl.GamepadID) bool
	Ping(ctx context.Context) (*viipertypes.PingResponse, error)
	Info() *viipertypes.PingResponse
	Ready() bool
	ResolvedAddressAndPort() string
	IsLoopbackAddress() bool
}

func NewViiperBridge

func NewViiperBridge(ctx context.Context, dl DeviceStore, cfg *config.Viiper) ViiperBridge

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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