gamepad

package
v2.8.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ButtonCount = 32

Variables

This section is empty.

Functions

func SetNativeWindow added in v2.4.0

func SetNativeWindow(nativeWindow uintptr)

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) IsAxisReady added in v2.6.7

func (g *Gamepad) IsAxisReady(axis int) bool

IsAxisReady is concurrent-safe.

func (*Gamepad) IsStandardAxisAvailable added in v2.4.0

func (g *Gamepad) IsStandardAxisAvailable(axis gamepaddb.StandardAxis) bool

IsStandardAxisAvailable is concurrent safe.

func (*Gamepad) IsStandardButtonAvailable added in v2.4.0

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

IsStandardButtonAvailable 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