Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7751203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:29:14+00:00 2026-06-01T11:29:14+00:00

I’m an amateur programmer who’s interested in adding a click-drag method to the vt320

  • 0

I’m an amateur programmer who’s interested in adding a click-drag method to the vt320 terminal emulator at http://javassh.org/download/source/de/mud/terminal/vt320.html. I’m looking through the source for mouse press function and came upon this:

byte b[] = new byte[6];
b[0] = 27;
b[1] = (byte) '[';
b[2] = (byte) 'M';
b[3] = (byte) mousecode;
b[4] = (byte) (0x20 + x + 1);
b[5] = (byte) (0x20 + y + 1);

write(b); // FIXME: writeSpecial here

Where x and y are the character positions and mousecode has to do with the mouse button. Seems fairly straightfoward to add a mouse drag message. Can anyone point me in the direction of what the bytes should be? Or am I missing a very obvious roadblock? I’m mostly interested in sending click-drag to vim, running on Connectbot for android. Seems like it would be a really sweet thing to have.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:29:16+00:00Added an answer on June 1, 2026 at 11:29 am

    Terminal mouse mode is perhaps best described by xterm’s ctlseqs document. In summary, when the terminal is in one of the mouse reporting modes, it sends events in the form

    CSI M Ps Px Py

    Where CSI is either the single C1 CSI control (0x9b) or the two-byte sequence ESC (0x1b) [.

    Ps, Px and Py encode the “status”, x and y coordinate, as a single byte which is offset by 0x20 to ensure it is a GL printable and not a C0 control byte. Px and Py should be obvious. Ps is a bitmask containing the following fields:

    • Bits 0 to 1 encode the button number; 0 to 2 for buttons 1 to 3, or 3 for a release (it does not encode which button was released)
    • Bit 2 is set if the Shift modifier is held (though most terminals will capture mouse internally and not report it to applications in this condition)
    • Bit 3 is set if the Alt modifier is held
    • Bit 4 is set if the Ctrl modifier is held
    • Bit 5 is set if the mouse event is a drag motion rather than a press.
    • Bit 6 is set to extend the mouse button range to buttons 4 and 5, used for the scroll wheel.

    There are three mouse modes that use this reporting, all set by DECSM; Set DEC private mode (CSI ? Pn h):

    • Mode 1000 reports mouse press and release events only
    • Mode 1002 reports mouse press, release, and motion when a button is held (drag)
    • Mode 1003 reports mouse press, release, and motion events even without a button held
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.