gamepaddb

package
v2.3.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HatUp    = 1
	HatRight = 2
	HatDown  = 4
	HatLeft  = 8
)

Variables

This section is empty.

Functions

func AxisValue

func AxisValue(id string, axis driver.StandardGamepadAxis, state GamepadState) float64

func ButtonValue

func ButtonValue(id string, button driver.StandardGamepadButton, state GamepadState) float64

func HasStandardLayoutMapping

func HasStandardLayoutMapping(id string) bool

func IsButtonPressed

func IsButtonPressed(id string, button driver.StandardGamepadButton, state GamepadState) bool

func Name added in v2.3.0

func Name(id string) string

func Update

func Update(mapping []byte) (bool, error)

Update adds new gamepad mappings. The string must be in the format of SDL_GameControllerDB.

Types

type GamepadState

type GamepadState interface {
	Axis(index int) float64
	Button(index int) bool
	Hat(index int) int
}

Jump to

Keyboard shortcuts

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