d2input

package
v0.0.0-...-7f92c57 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package d2input provides an input manager

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrHasReg shows the input system already has a registered handler
	ErrHasReg = errors.New("input system already has provided handler")
	// ErrNotReg shows the input system has no registered handler
	ErrNotReg = errors.New("input system does not have provided handler")
)

Functions

func NewInputManager

func NewInputManager() d2interface.InputManager

NewInputManager returns a new input manager instance

Types

type HandlerEvent

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

HandlerEvent is an event that EventHandlers will process and respond to

func (*HandlerEvent) ButtonMod

func (e *HandlerEvent) ButtonMod() d2enum.MouseButtonMod

ButtonMod yields the modifier for a button action

func (*HandlerEvent) KeyMod

func (e *HandlerEvent) KeyMod() d2enum.KeyMod

KeyMod yields the modifier for a key action

func (*HandlerEvent) X

func (e *HandlerEvent) X() int

X returns the x screen coordinate for the event

func (*HandlerEvent) Y

func (e *HandlerEvent) Y() int

Y returns the y screen coordinate for the event

type KeyCharsEvent

type KeyCharsEvent struct {
	HandlerEvent
	// contains filtered or unexported fields
}

KeyCharsEvent represents a key character event

func (*KeyCharsEvent) Chars

func (e *KeyCharsEvent) Chars() []rune

Chars returns the characters

type KeyEvent

type KeyEvent struct {
	HandlerEvent
	// contains filtered or unexported fields
}

KeyEvent represents key events

func (*KeyEvent) Duration

func (e *KeyEvent) Duration() int

Duration returns the duration

func (*KeyEvent) Key

func (e *KeyEvent) Key() d2enum.Key

Key returns the key

type MouseEvent

type MouseEvent struct {
	HandlerEvent
	// contains filtered or unexported fields
}

MouseEvent represents a mouse event

func (*MouseEvent) Button

func (e *MouseEvent) Button() d2enum.MouseButton

Button returns the mouse button

func (*MouseEvent) ButtonMod

func (e *MouseEvent) ButtonMod() d2enum.MouseButtonMod

ButtonMod represents a button mod

func (*MouseEvent) KeyMod

func (e *MouseEvent) KeyMod() d2enum.KeyMod

KeyMod returns the key mod

func (*MouseEvent) X

func (e *MouseEvent) X() int

X returns the event's X position

func (*MouseEvent) Y

func (e *MouseEvent) Y() int

Y returns the event's Y position

type MouseMoveEvent

type MouseMoveEvent struct {
	HandlerEvent
}

MouseMoveEvent represents a mouse movement event

func (*MouseMoveEvent) ButtonMod

func (e *MouseMoveEvent) ButtonMod() d2enum.MouseButtonMod

ButtonMod represents the button mod

func (*MouseMoveEvent) KeyMod

func (e *MouseMoveEvent) KeyMod() d2enum.KeyMod

KeyMod represents the key mod

func (*MouseMoveEvent) X

func (e *MouseMoveEvent) X() int

X represents the X position

func (*MouseMoveEvent) Y

func (e *MouseMoveEvent) Y() int

Y represents the Y position

Directories

Path Synopsis
Package ebiten provides graphics and input API to develop a 2D game.
Package ebiten provides graphics and input API to develop a 2D game.

Jump to

Keyboard shortcuts

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