event/key: make Event implement fmt.Stringer.
Change-Id: I453bed283767e0adf5efd271b329a469c0073d69 Reviewed-on: https://go-review.googlesource.com/13733 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
ab223cffc9
commit
3a0fcd575e
|
@ -54,6 +54,13 @@ type Event struct {
|
|||
// TODO: add a time.Time?
|
||||
}
|
||||
|
||||
func (e Event) String() string {
|
||||
if e.Rune >= 0 {
|
||||
return fmt.Sprintf("key.Event{%q (%v), %v, %v}", e.Rune, e.Code, e.Modifiers, e.Direction)
|
||||
}
|
||||
return fmt.Sprintf("key.Event{(%v), %v, %v}", e.Code, e.Modifiers, e.Direction)
|
||||
}
|
||||
|
||||
// Direction is the direction of the key event.
|
||||
type Direction uint8
|
||||
|
||||
|
|
Loading…
Reference in New Issue