input

package
v0.0.0-...-77e18a0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllKeys = map[Key]bool{
	KeyDown:  true,
	KeyUp:    true,
	KeyW:     true,
	KeyS:     true,
	KeySpace: true,
}

Functions

func AddPressedKey

func AddPressedKey(k Key, t time.Time)

func IsKeyJustPressed

func IsKeyJustPressed(k Key) bool

func IsKeyJustReleased

func IsKeyJustReleased(k Key) bool

func IsKeyPressed

func IsKeyPressed(k Key) bool

func KeyPressDuration

func KeyPressDuration(k Key) int

func UpdateInputState

func UpdateInputState()

Types

type Key

type Key string
const (
	KeyUp    Key = "up"
	KeyDown  Key = "down"
	KeyW     Key = "w"
	KeyS     Key = "s"
	KeySpace Key = "space"
)

func (Key) IsValid

func (k Key) IsValid() bool

Jump to

Keyboard shortcuts

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