1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-04 09:17:17 -05:00
OpenDiablo2/d2core/d2input/key_event.go
2020-07-26 14:52:54 -04:00

22 lines
425 B
Go

package d2input
import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
// KeyEvent represents key events
type KeyEvent struct {
HandlerEvent
key d2enum.Key
// Duration represents the number of frames this key has been pressed for
duration int
}
// Key returns the key
func (e *KeyEvent) Key() d2enum.Key {
return e.key
}
// Duration returns the duration
func (e *KeyEvent) Duration() int {
return e.duration
}