Skip to content

Wheel event frequency in mouse mode too high when using a touchpad #3848

@pfitzseb

Description

@pfitzseb

When the vt200 mouse mode is enabled, touch scrolling emits wheel events with a very high frequency. I suspect this happens because

if ((ev as WheelEvent).deltaY !== 0) {
action = (ev as WheelEvent).deltaY < 0 ? CoreMouseAction.UP : CoreMouseAction.DOWN;
}

only checks that deltaY !== 0, instead of summing multiple deltaYs until the sum is greater than some threshold.

The real-world consequence of this is that tmux mouse-scrolling (well, touchpad scrolling) is basically unusable because the sensitivity is way too high.

Details

  • Browser and browser version: Electron 17.4.1/Chromium 98/VS Code 1.67
  • OS version: Manjaro
  • xterm.js version: Whatever is shipped in VS Code, but also doesn't really matter

Steps to reproduce

  1. printf "\e[?1000h" in an xterm.js terminal and a more native terminal (I was using alacritty, the original report was about whatever terminal is the default on Macs)
  2. Use a touchpad to scroll
  3. Check the frequency of the emitted scroll events

Or just start tmux and enable mouse mode via set -g mouse on; you should notice a difference in scroll speed between the two terminals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions