don't record buttondn on scroll events

This commit is contained in:
Matthew Roseman 2023-03-15 15:28:12 -04:00 committed by Garrett D'Amore
parent c14349d151
commit b9a2bbda10
1 changed files with 3 additions and 1 deletions

View File

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