Only send wheel mouse event when scrolling a line or more

This commit is contained in:
Sebastian Pfitzner
2022-06-22 11:52:00 +02:00
parent 52044e9aad
commit 44e4b56ced
+6 -3
View File
@@ -703,10 +703,13 @@ export class Terminal extends CoreTerminal implements ITerminal {
but = ev.button < 3 ? ev.button : CoreMouseButton.NONE;
break;
case 'wheel':
// only UP/DOWN wheel events are respected
if ((ev as WheelEvent).deltaY !== 0) {
action = (ev as WheelEvent).deltaY < 0 ? CoreMouseAction.UP : CoreMouseAction.DOWN;
const amount = self.viewport!.getLinesScrolled(ev as WheelEvent)
if (amount === 0) {
return false
}
action = (ev as WheelEvent).deltaY < 0 ? CoreMouseAction.UP : CoreMouseAction.DOWN;
but = CoreMouseButton.WHEEL;
break;
default: