input

package
v0.0.0-...-33f8f51 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BUTTON_A ControllerButton = iota
	BUTTON_B
	BUTTON_X
	BUTTON_Y
	BUTTON_BACK
	BUTTON_GUIDE
	BUTTON_START
	BUTTON_LEFT_STICK
	BUTTON_RIGHT_STICK
	BUTTON_LEFT_SHOULDER
	BUTTON_RIGHT_SHOULDER
	BUTTON_DIR_PAD_UP
	BUTTON_DIR_PAD_DOWN
	BUTTON_DIR_PAD_LEFT
	BUTTON_DIR_PAD_RIGHT
	AXIS_LEFT_X ControllerAxis = iota
	AXIS_LEFT_Y
	AXIS_RIGHT_X
	AXIS_RIGHT_Y
	AXIS_TRIGGER_LEFT
	AXIS_TRIGGER_RIGHT

	MAX_NUM_JOYSTICKS = glfw.JoystickLast
)

Variables

View Source
var (
	JoystickControllers map[int]*JoystickController
)

Functions

This section is empty.

Types

type ControllerAxis

type ControllerAxis int

type ControllerButton

type ControllerButton int

type GameController

type GameController interface {
	Connected() bool
	Open(deviceIndex int) bool
	Close()
	Update()
	NumButtons() int
	NumAxes() int
	ButtonPressed(button ControllerButton) bool
	ButtonReleased(button ControllerButton) bool
	ButtonDown(button ControllerButton) bool
	AxisValue(axis ControllerAxis) float32
	AxisDigitalValue(axis ControllerAxis) int
	SetMapping(mapping *GameControllerMapping)
	Description() string
}

type GameControllerMapping

type GameControllerMapping struct {
	// contains filtered or unexported fields
}
var (
	GameControllerMappings []*GameControllerMapping
	MappingXBox360         GameControllerMapping
	MappingPS4             GameControllerMapping
	MappingKeyboard        GameControllerMapping
)

type JoystickController

type JoystickController struct {
	GameController
	// contains filtered or unexported fields
}

func (*JoystickController) AxisDigitalValue

func (c *JoystickController) AxisDigitalValue(axis ControllerAxis) int

func (*JoystickController) AxisValue

func (c *JoystickController) AxisValue(axis ControllerAxis) float32

func (*JoystickController) ButtonDown

func (c *JoystickController) ButtonDown(button ControllerButton) bool

func (*JoystickController) ButtonPressed

func (c *JoystickController) ButtonPressed(button ControllerButton) bool

func (*JoystickController) ButtonReleased

func (c *JoystickController) ButtonReleased(button ControllerButton) bool

func (*JoystickController) Close

func (c *JoystickController) Close()

func (*JoystickController) Connected

func (c *JoystickController) Connected() bool

func (*JoystickController) Description

func (c *JoystickController) Description() string

func (*JoystickController) NumAxis

func (c *JoystickController) NumAxis() int

func (*JoystickController) NumButtons

func (c *JoystickController) NumButtons() int

func (*JoystickController) Open

func (c *JoystickController) Open(deviceIndex int) bool

func (*JoystickController) SetMapping

func (c *JoystickController) SetMapping(mapping *GameControllerMapping)

func (*JoystickController) Update

func (c *JoystickController) Update()

type KeyboardController

type KeyboardController struct {
	GameController
	// contains filtered or unexported fields
}

func (*KeyboardController) AxisDigitalValue

func (c *KeyboardController) AxisDigitalValue(axis ControllerAxis) int

func (*KeyboardController) AxisValue

func (c *KeyboardController) AxisValue(axis ControllerAxis) float32

func (*KeyboardController) ButtonDown

func (c *KeyboardController) ButtonDown(button ControllerButton) bool

func (*KeyboardController) ButtonPressed

func (c *KeyboardController) ButtonPressed(button ControllerButton) bool

func (*KeyboardController) ButtonReleased

func (c *KeyboardController) ButtonReleased(button ControllerButton) bool

func (*KeyboardController) Close

func (c *KeyboardController) Close()

func (*KeyboardController) Connected

func (c *KeyboardController) Connected() bool

func (*KeyboardController) Description

func (c *KeyboardController) Description() string

func (*KeyboardController) NumAxis

func (c *KeyboardController) NumAxis() int

func (*KeyboardController) NumButtons

func (c *KeyboardController) NumButtons() int

func (*KeyboardController) Open

func (c *KeyboardController) Open(_ int) bool

func (*KeyboardController) SetMapping

func (c *KeyboardController) SetMapping(mapping *GameControllerMapping)

func (*KeyboardController) Update

func (c *KeyboardController) Update()

Jump to

Keyboard shortcuts

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