Skip to content
This repository has been archived by the owner on Sep 4, 2022. It is now read-only.

Mouse Tracking

Gustav Dersjö edited this page May 13, 2021 · 13 revisions

Mouse Tracking

Most linux terminals seem to have implemented support for mouse tracking, however most terminals intended for being used with BBS'es either don't, or they deviate from the standards set by Xterm. This page is intended to describe both the established standards, as well as most of the non-standard implementations out there.

Mouse tracking formats

Xterm

Xterm's mouse format is the most common standard. It supports a wide variety of mouse tracking modes, featuring motion tracking and selection features.

  • To enable mouse tracking: $CSI ? <mode (%d...)> h
  • To disable mouse tracking: $CSI ? <mode (%d...)> l

Mouse tracking modes

tbd.

NetRunner

NetRunner (a terminal for BBSing) deviates from the standard mouse protocols proposed by the xterm specifications.

  • Initiated by $CSI ? 1000 h.
  • Somewhat based on the Xterm spec, but not 100% compatible
    • Values are offset by 40 instead of 32.
    • The sequences are formatted as $CSI M 0 <x (%s)> <y (%s)>, does not follow Xterm specifications.
    • Only supports mode 1000, meaning there is no support for movement tracking.
    • Deviates from xterm standard by only sending the starting click, meaning there is no support for mouse drag.

SyncTERM

SyncTERM (a terminal for BBSing) deviates from the standard mouse protocols proposed by the xterm specifications.

I haven't managed to get SyncTERM's mouse tracking to work, but supposedly the following is true about it (take this with a grain of salt)...

  • Initiated by $CSI = 255 h $CSI ? 1000 h.
    • $CSI = 255 h enables doorway mode, which supposedly is needed for it to work.
  • Somewhat based on the Xterm spec, but not 100% compatible
    • The sequences are formatted the same as Xterm
    • Only supports mode 1000, meaning there is no support for movement tracking.
    • Deviates from xterm standard by only sending the starting click, meaning there is no support for mouse drag.

The modifier byte

The modifier byte tells us more information about the button press.

Mouse mod bits
             1
            2|
           4||
          8|||
        16||||
       32|||||
      64||||||
    128|||||||
      ||||||||
      vvvvvvvv
      00000000
      --^--^-^
        |  | |
more info  | |
   modifiers |
        button

Button options
0 = MB1 pressed
1 = MB2 pressed
2 = MB3 pressed
3 = released

Project Accela

Specifications

Terminal

Network protocol

Clone this wiki locally