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
type KeyEvent ¶
type KeyEvent struct { HandlerEvent // contains filtered or unexported fields }
KeyEvent represents key events
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
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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.