gamepad

package
v0.28.0-rc0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package gamepad implements a linux gamepad as an input controller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewController

func NewController(
	ctx context.Context, _ resource.Dependencies, conf resource.Config, logger logging.Logger,
) (input.Controller, error)

NewController creates a new gamepad.

Types

type Config

type Config struct {
	resource.TriviallyValidateConfig
	DevFile       string `json:"dev_file,omitempty"`
	AutoReconnect bool   `json:"auto_reconnect,omitempty"`
}

Config is used for converting config attributes.

type Mapping

type Mapping struct {
	Buttons map[evdev.KeyType]input.Control
	Axes    map[evdev.AbsoluteType]input.Control
}

Mapping represents the evdev code to input.Control mapping for a given gamepad model.

func MappingForModel added in v0.2.35

func MappingForModel(model string) (Mapping, bool)

MappingForModel returns the mapping for a given model.

Jump to

Keyboard shortcuts

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