keyboard

package
v0.0.0-...-476d645 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LeftShift  = 1073742049
	RightShift = 1073742053
	CapsLock   = 1073741881
	Enter      = 13
	Backspace  = 8
	Escape     = 27
)

Defines keyboard runes

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyInput

type KeyInput struct {
	Key  rune
	Type uint32
}

KeyInput is a single key that is sent to the screen object

func NewKeyInputFromEvent

func NewKeyInputFromEvent(e *sdl.KeyboardEvent) *KeyInput

NewKeyInputFromEvent creates a new key input from a keyboard event

type Keyboard

type Keyboard struct {
	// contains filtered or unexported fields
}

Keyboard represents a physical keyboard

func NewKeyboard

func NewKeyboard() *Keyboard

NewKeyboard creates a new keyboard

func (*Keyboard) ProcessKeyInput

func (k *Keyboard) ProcessKeyInput(i *KeyInput) rune

ProcessKeyInput processes a keyboard event

Jump to

Keyboard shortcuts

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