Skip to content

Expose mouse input dispatch and tracking mode - #253

Open
paulburton wants to merge 1 commit into
connectbot:mainfrom
paulburton:mouse-reporting
Open

Expose mouse input dispatch and tracking mode#253
paulburton wants to merge 1 commit into
connectbot:mainfrom
paulburton:mouse-reporting

Conversation

@paulburton

Copy link
Copy Markdown

Surface libvterm's mouse support through the terminal API:

  • Add dispatchMouseMove(row, col) and dispatchMouseButton(button, pressed) to TerminalEmulator, bridged through TerminalNative to vterm_mouse_move/vterm_mouse_button. Coordinates are 0-based cell indices (libvterm adds the wire offset itself); buttons 1-3 are left/middle/right and 4/5 are wheel up/down.
  • Expose the host-requested mode as mouseTracking: StateFlow, driven by VTERM_PROP_MOUSE, so a UI can tell when the host wants the mouse and otherwise leave gestures to the local UI.

libvterm encodes the reports for the active mode and protocol and emits them through the existing keyboard-input callback, so no new output path is needed.

Surface libvterm's mouse support through the terminal API:

- Add dispatchMouseMove(row, col) and dispatchMouseButton(button,
  pressed) to TerminalEmulator, bridged through TerminalNative to
  vterm_mouse_move/vterm_mouse_button. Coordinates are 0-based cell
  indices (libvterm adds the wire offset itself); buttons 1-3 are
  left/middle/right and 4/5 are wheel up/down.
- Expose the host-requested mode as mouseTracking:
  StateFlow<MouseTracking>, driven by VTERM_PROP_MOUSE, so a UI can
  tell when the host wants the mouse and otherwise leave gestures to
  the local UI.

libvterm encodes the reports for the active mode and protocol and emits
them through the existing keyboard-input callback, so no new output
path is needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant