joystick

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventJoyAxis   = iota // Joystick axis event
	EventJoyButton        // Joystick button event
)

Joystick event types

Variables

This section is empty.

Functions

This section is empty.

Types

type JoyEvent

type JoyEvent struct {
	device.Event      // Is a device event
	ID           byte // Joystick ID
	Axis         byte // Axis number
	AxisValue    byte // Axis value
	Button       byte // Button number
	ButtonState  byte // Button state
}

JoyEvent is a joystick event

func NewJoyAxisEvent

func NewJoyAxisEvent(id, axis, value byte) *JoyEvent

NewJoyAxisEvent creates a joystick axis event

func NewJoyButtonEvent

func NewJoyButtonEvent(id, button, state byte) *JoyEvent

NewJoyButtonEvent creates a joystick axis event

type Joystick

type Joystick interface {
	device.Device                      // Is a device
	SetAxis(axis byte, value byte)     // Sets axis value
	SetButton(button byte, state byte) // Sets button state
}

Joystick device

Jump to

Keyboard shortcuts

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