From a92c043b0bb4238fb13bbd6276599416ff50d97f Mon Sep 17 00:00:00 2001 From: Matthew Roseman Date: Mon, 27 Mar 2023 09:45:20 -0400 Subject: [PATCH] simplified bitwise math to determine if mouse scrolling --- tscreen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tscreen.go b/tscreen.go index cdfa203..8fc8866 100644 --- a/tscreen.go +++ b/tscreen.go @@ -1346,7 +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 + scroll = (btn & 0x42) == 0x40 btn &^= 32 if b[i] == 'm' { // mouse release, clear all buttons