gamepad

package
v2.4.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ButtonNum = 32

Variables

This section is empty.

Functions

func Update

func Update() error

Update is concurrent-safe.

Types

type Button

type Button int
const (
	Button0 Button = iota
	Button1
	Button2
	Button3
	Button4
	Button5
	Button6
	Button7
	Button8
	Button9
	Button10
	Button11
	Button12
	Button13
	Button14
	Button15
	Button16
	Button17
	Button18
	Button19
	Button20
	Button21
	Button22
	Button23
	Button24
	Button25
	Button26
	Button27
	Button28
	Button29
	Button30
	Button31
)

type Gamepad

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

func Get

func Get(id ID) *Gamepad

Get is concurrent-safe.

func (*Gamepad) Axis

func (g *Gamepad) Axis(axis int) float64

Axis is concurrent-safe.

func (*Gamepad) AxisCount

func (g *Gamepad) AxisCount() int

AxisCount is concurrent-safe.

func (*Gamepad) Button

func (g *Gamepad) Button(button int) bool

Button is concurrent-safe.

func (*Gamepad) ButtonCount

func (g *Gamepad) ButtonCount() int

ButtonCount is concurrent-safe.

func (*Gamepad) Hat

func (g *Gamepad) Hat(hat int) int

Hat is concurrent-safe.

func (*Gamepad) HatCount

func (g *Gamepad) HatCount() int

HatCount is concurrent-safe.

func (*Gamepad) IsStandardButtonPressed

func (g *Gamepad) IsStandardButtonPressed(button gamepaddb.StandardButton) bool

IsStandardButtonPressed is concurrent-safe.

func (*Gamepad) IsStandardLayoutAvailable

func (g *Gamepad) IsStandardLayoutAvailable() bool

IsStandardLayoutAvailable is concurrent-safe.

func (*Gamepad) Name

func (g *Gamepad) Name() string

Name is concurrent-safe.

func (*Gamepad) SDLID

func (g *Gamepad) SDLID() string

SDLID is concurrent-safe.

func (*Gamepad) StandardAxisValue

func (g *Gamepad) StandardAxisValue(axis gamepaddb.StandardAxis) float64

StandardAxisValue is concurrent-safe.

func (*Gamepad) StandardButtonValue

func (g *Gamepad) StandardButtonValue(button gamepaddb.StandardButton) float64

StandardButtonValue is concurrent-safe.

func (*Gamepad) Vibrate

func (g *Gamepad) Vibrate(duration time.Duration, strongMagnitude float64, weakMagnitude float64)

Vibrate is concurrent-safe.

type ID

type ID int

func AppendGamepadIDs

func AppendGamepadIDs(ids []ID) []ID

AppendGamepadIDs is concurrent-safe.

Jump to

Keyboard shortcuts

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