input

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// None indicates no modifiers
	None Modifier = 0
	// Alt indicates Left Alt is pressed
	Alt = 1
	// Ctrl indicated that either Ctrl key is pressed
	Ctrl = 2
)

Variables

This section is empty.

Functions

func Register

func Register(event KeyEvent, listener KeyListener)

Register associates a KeyListener with a specific KeyEvent

func Update

func Update()

Update reads all of the currently pressed keys and compares them against previously pressed keys to generate KeyEvents

Types

type KeyEvent

type KeyEvent struct {
	Key   ebiten.Key
	Mod   Modifier
	State State
}

KeyEvent represents the combinator of a normal key, modifier keys, and a State, used to represent an Event to scan for

type KeyListener

type KeyListener func(ke KeyEvent)

KeyListener is a function to call in response to a KeyEvent

type Modifier

type Modifier int

Modifier represents zero or more modifier keys

type State

type State int

State indicates the state of a Key

const (
	// Pressed indicates a Key was just pressed
	Pressed State = iota
	// Released indicated a Key was just released
	Released
)

Jump to

Keyboard shortcuts

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