Skip to content

Touch scrolling should send arrow keys like how wheel events are translated #1007

Open
@jdmayfield

Description

@jdmayfield

I have a touchmove event on the terminal element that sends ansi cursor arrows down a websocket when swiped to allow easy navigation on mobile. Works great in application mode (i.e. Midnight Commander), but when on the default screen-buffer, the terminal wants to scroll. How can I programmatically disable and re-enable touch-scrolling on the terminal (without changing the buffers "scrollback")? I tried event.preventDefault(). Tried attaching the event to the terminals parentNode, its parentNode, xterm-rows, tried changing css overflow-y on a variety of elements, absolute positioning, etc. Is there an ansi code I can use for this? Some way to intercept whatever event makes the terminal "scroll"? Only solution so far is to term.scrollToBottom() every touchmove, but it jitters a lot when swiping downward. Any help would be awesome! Thank you in advance!!

Details

  • Browser and browser version: Chrome 59
  • OS version: Android 5
  • xterm.js version: 2.8.1

Steps to reproduce

  1. add touchmove event to terminal element that sends "\x1bOA" and "x1bOB" when swiped up or down.
  2. test in Midnight Commander t

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions