diff --git a/tscreen.go b/tscreen.go index e36e6e4..cdfa203 100644 --- a/tscreen.go +++ b/tscreen.go @@ -1271,6 +1271,7 @@ func (t *tScreen) parseSgrMouse(buf *bytes.Buffer, evs *[]Event) (bool, bool) { dig := false neg := false motion := false + scroll := false i := 0 val := 0 @@ -1345,6 +1346,7 @@ func (t *tScreen) parseSgrMouse(buf *bytes.Buffer, evs *[]Event) (bool, bool) { y = val - 1 motion = (btn & 32) != 0 + scroll = (btn & 0x43) == 0x40 || (btn & 0x43) == 0x41 btn &^= 32 if b[i] == 'm' { // mouse release, clear all buttons @@ -1363,7 +1365,7 @@ func (t *tScreen) parseSgrMouse(buf *bytes.Buffer, evs *[]Event) (bool, bool) { btn |= 3 btn &^= 0x40 } - } else { + } else if !scroll { t.buttondn = true } // consume the event bytes