gamepaddb

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 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 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