input

package
v0.0.0-...-6831a9c Latest Latest
Warning

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

Go to latest
Published: May 25, 2017 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	IsDown(InputType) bool
	Update(sdl.Event)
	ResetMapping()
}

Controller is an abstraction of the keyboard or a game controller (PS4, XBox1, Steam,...)

func NewGameController

func NewGameController() Controller

func NewKeyboardController

func NewKeyboardController() Controller

NewKeyboardController creates a new Controller with the given KeyboardMapping

type InputType

type InputType int

InputType is an abstract layer between controller/keyboard input and the input the game will receive

const (
	InputUp InputType = iota
	InputDown
	InputLeft
	InputRight

	InputOK
	InputBack

	InputPause

	InputInteract
	InputAttack
	InputUseItem
)

The InputTypes, which can be used

type Mapping

type Mapping map[int][]InputType

Mapping maps a key to an InputType

Jump to

Keyboard shortcuts

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