Skip to content

Commit

Permalink
simplified bitwise math to determine if mouse scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
mattroseman authored and gdamore committed Aug 15, 2023
1 parent b9a2bbd commit a92c043
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tscreen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a92c043

Please sign in to comment.