1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-02 17:27:23 -04:00
OpenDiablo2/d2common/d2interface/input_events.go
dk 60e6fcb7ac
moving enumerations out of d2interface (#552)
* moved filter constants back to d2enum

* moving key and mouse button enums into d2enum

* moving render type enum into d2enum

* moving input even priority enums into d2enum

* moving terminal enums into d2enum
2020-07-06 21:26:08 -04:00

37 lines
834 B
Go

package d2interface
import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
// HandlerEvent holds the qualifiers for a key or mouse event
type HandlerEvent interface {
KeyMod() d2enum.KeyMod
ButtonMod() d2enum.MouseButtonMod
X() int
Y() int
}
// KeyEvent represents an event associated with a keyboard key
type KeyEvent interface {
HandlerEvent
Key() d2enum.Key
// Duration represents the number of frames this key has been pressed for
Duration() int
}
// KeyCharsEvent represents an event associated with a keyboard character being pressed
type KeyCharsEvent interface {
HandlerEvent
Chars() []rune
}
// MouseEvent represents a mouse event
type MouseEvent interface {
HandlerEvent
Button() d2enum.MouseButton
}
// MouseMoveEvent represents a mouse movement event
type MouseMoveEvent interface {
HandlerEvent
}