input

package
v1.0.0-rc.106 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Left       = (&impulse{Name: "Left", keys: leftKeys, padControls: leftPad}).register()
	Right      = (&impulse{Name: "Right", keys: rightKeys, padControls: rightPad}).register()
	Up         = (&impulse{Name: "Up", keys: upKeys, padControls: upPad}).register()
	Down       = (&impulse{Name: "Down", keys: downKeys, padControls: downPad}).register()
	Jump       = (&impulse{Name: "Jump", keys: jumpKeys, padControls: jumpPad}).register()
	Action     = (&impulse{Name: "Action", keys: actionKeys, padControls: actionPad}).register()
	Exit       = (&impulse{Name: "Exit", keys: exitKeys, padControls: exitPad}).register()
	Fullscreen = (&impulse{Name: "Fullscreen", keys: fullscreenKeys}).register()
)

Functions

func EasterEggJustHit

func EasterEggJustHit() bool

func Init

func Init() error

func LoadFromDemo

func LoadFromDemo(state *DemoState)

func Update

func Update()

Types

type DemoState

type DemoState struct {
	InputMap         InputMap      `json:",omitempty"`
	Left             *ImpulseState `json:",omitempty"`
	Right            *ImpulseState `json:",omitempty"`
	Up               *ImpulseState `json:",omitempty"`
	Down             *ImpulseState `json:",omitempty"`
	Jump             *ImpulseState `json:",omitempty"`
	Action           *ImpulseState `json:",omitempty"`
	Exit             *ImpulseState `json:",omitempty"`
	EasterEggJustHit bool          `json:",omitempty"`
}

func SaveToDemo

func SaveToDemo() *DemoState

type ImpulseState

type ImpulseState struct {
	Held    bool `json:",omitempty"`
	JustHit bool `json:",omitempty"`
}

func (*ImpulseState) Empty

func (i *ImpulseState) Empty() bool

func (*ImpulseState) OrEmpty

func (i *ImpulseState) OrEmpty() ImpulseState

func (*ImpulseState) UnlessEmpty

func (i *ImpulseState) UnlessEmpty() *ImpulseState

type InputMap

type InputMap int
const (
	NoInput     InputMap = 0
	DOSKeyboard InputMap = 1
	NESKeyboard InputMap = 2
	FPSKeyboard InputMap = 4
	ViKeyboard  InputMap = 8
	AnyKeyboard InputMap = DOSKeyboard | NESKeyboard | FPSKeyboard | ViKeyboard
	Gamepad     InputMap = 16
	AnyInput    InputMap = AnyKeyboard | Gamepad
)

func Map

func Map() InputMap

func (InputMap) ContainsAny

func (i InputMap) ContainsAny(o InputMap) bool

Jump to

Keyboard shortcuts

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