1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-15 16:56:00 -05:00
OpenDiablo2/d2core/d2input/key_event.go

22 lines
425 B
Go
Raw Normal View History

2020-07-26 14:52:54 -04:00
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
}