mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-02 17:27:23 -04:00
62b8a610c0
* abstract d2input manager/service/events/keys/buttons to interface * abstract d2input manager/service/events/keys/buttons to interface * fixing lint error
35 lines
745 B
Go
35 lines
745 B
Go
package d2interface
|
|
|
|
// HandlerEvent holds the qualifiers for a key or mouse event
|
|
type HandlerEvent interface {
|
|
KeyMod() KeyMod
|
|
ButtonMod() MouseButtonMod
|
|
X() int
|
|
Y() int
|
|
}
|
|
|
|
// KeyEvent represents an event associated with a keyboard key
|
|
type KeyEvent interface {
|
|
HandlerEvent
|
|
Key() 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() MouseButton
|
|
}
|
|
|
|
// MouseMoveEvent represents a mouse movement event
|
|
type MouseMoveEvent interface {
|
|
HandlerEvent
|
|
}
|