From 8025748828dbfb4429823b77d2cb09c105a360f0 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 13 Jul 2020 11:26:57 -0400 Subject: [PATCH] Some comments on mouse stuff --- mouse.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mouse.go b/mouse.go index 3ceb831..5c2bcaf 100644 --- a/mouse.go +++ b/mouse.go @@ -4,6 +4,8 @@ import "errors" type MouseMsg MouseEvent +// MouseEvent represents a mouse event, which could be a click, a scroll wheel +// movement, a cursor movement, or a combination. type MouseEvent struct { X int Y int @@ -12,6 +14,7 @@ type MouseEvent struct { Ctrl bool } +// String returns a string representation of a mouse event. func (m MouseEvent) String() (s string) { if m.Ctrl { s += "ctrl+" @@ -23,6 +26,7 @@ func (m MouseEvent) String() (s string) { return s } +// MouseButton represents a mouse button event. type MouseButton int const ( @@ -47,7 +51,7 @@ var mouseButtonNames = map[MouseButton]string{ MouseMotion: "motion", } -// Parse an X10-encoded mouse event. The simplest kind. The last release of +// Parse an X10-encoded mouse event; the simplest kind. The last release of // X10 was December 1986, by the way. // // X10 mouse events look like: