Skip to content
Myr

Some comments on mouse stuff

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent 14a06b0 · Browse files · 1 file+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−1 removed

  • other:+5 added−1 removed

1 file+5 added−1 removed

modified:mouse.go+5 added-1 removed
2 unmodified lines
3import "errors"45type MouseMsg MouseEvent67// MouseEvent represents a mouse event, which could be a click, a scroll wheel8// movement, a cursor movement, or a combination.9type MouseEvent struct {10 X int11 Y int12 Button MouseButton13 Alt bool14 Ctrl bool15}1617// String returns a string representation of a mouse event.18func (m MouseEvent) String() (s string) {19 if m.Ctrl {20 s += "ctrl+"21 }
3 unmodified lines
25 s += mouseButtonNames[m.Button]26 return s27}2829// MouseButton represents a mouse button event.30type MouseButton int3132const (33 MouseUnknown MouseButton = iota
16 unmodified lines
50 MouseWheelDown: "wheel down",51 MouseMotion: "motion",52}5350// Parse an X10-encoded mouse event. The simplest kind. The last release of54// Parse an X10-encoded mouse event; the simplest kind. The last release of55// X10 was December 1986, by the way.56//57// X10 mouse events look like:58//
50 unmodified lines