mirror of https://github.com/gdamore/tcell.git
don't record buttondn on scroll events
This commit is contained in:
parent
c14349d151
commit
b9a2bbda10
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue