• Mouse support in Netrunner2 (or Mystic?)

    From Rob Swindell to All on Sunday, May 17, 2020 17:51:41
    So I was playing with mouse support in Synchronet. It works great with xterm and SyncTERM using the X10 mouse protocol with either the legacy encoding (e.g. coordinates of 1,1 is encoded as '!!') or the preferred SGR-extended encoding (e.g. where coordinates 1,1 is encoded as '1;1'). Left-button presses are encoded as space (0x20) in legacy encoding and '0' in SGR-extended encoding.

    This is an example upper-left left-button click in SGR-extended encoding X10 compatible mouse mode:
    27 1b
    91 5b '['
    60 3c '<'
    48 30 '0'
    59 3b ';'
    49 31 '1'
    59 3b ';'
    49 31 '1'
    77 4d 'M'

    And this is the legacy encoding of the same thing (limiting the size of the terminal screen):
    27 1b
    91 5b '['
    77 4d 'M'
    32 20 ' '
    33 21 '!'
    33 21 '!'

    Here's a good reference:
    https://invisible-island.net/xterm/ctlseqs/ctlseqs.pdf

    However, when testing with Netrunner2, an upper-left left-button click sends this:
    27 1b
    91 5b '['
    77 4d 'M'
    48 30 '0'
    41 29 ')'
    41 29 ')'

    What mouse protocol is this and do you have a reference document?

    digital man

    Synchronet "Real Fact" #102:
    Alternate and loadable font support was added to Synchronet in February 2018. Norco, CA WX: 74.3°F, 60.0% humidity, 13 mph E wind, 0.00 inches rain/24hrs
  • From g00r00@1:129/215 to Rob Swindell on Sunday, May 17, 2020 21:35:27
    However, when testing with Netrunner2, an upper-left left-button click sends this:
    27 1b
    91 5b '['
    77 4d 'M'
    48 30 '0'
    41 29 ')'
    41 29 ')'

    What mouse protocol is this and do you have a reference document?

    Hey Rob,

    I'd be happy to (try to) help!

    The latest NetRunner is beta 19 which uses either XTERM(?) or maybe VT200(?) mouse support. I used whatever the default was in PUTTY at the time so that it'd be compatible with Mystic "out of the box".

    I used to have a bookmark that had a reference but I can't seem to find it at the moment. I read through my code and I did have some source code notes
    that I can pass along, and a chunk of code from PUTTY that can be used as a reference to its various mouse modes.

    (Some observations that I just made by looking at my code:)

    (It looks like the X/Y coordinates are just the ascii character corresponding to the X/Y coordinate with with +32 added to it to avoid conflict with low ascii control characters. So coordinates 1, 1 would be represented as Ascii#33;Ascii#33. This means its limited to a terminal size of 223x223 though which is something I overlooked at the time. It also looks like Mystic sends esc[?1000h to the Unix terminal when running in Unix to enable mouse reporting, so that seems like a clue we can Google to find out officially what it is. NetRunner also translates a wheel spin to either the up or down arrow ANSI escape sequence for max usefulness with non-mouse-aware BBSes)

    Notes:

    (* PUTTY
    ESC[Ma;b;c
    // low two bits of "a" encode button: 0=MB1 pressed, 1=2 pressed, 2=3
    // pressed, 3=release
    // next 3 bits encode modifiers (4=shift,8=meta,16=control)
    // b,c are x and y coordinates of cursor

    int encstate = 0, r, c, wheel;
    char abuf[32];
    int len = 0;

    if (term->ldisc) {

    switch (braw) {
    case MBT_LEFT:
    encstate = 0x00; /* left button down */
    wheel = FALSE;
    break;
    case MBT_MIDDLE:
    encstate = 0x01;
    wheel = FALSE;
    break;
    case MBT_RIGHT:
    encstate = 0x02;
    wheel = FALSE;
    break;
    case MBT_WHEEL_UP:
    encstate = 0x40;
    wheel = TRUE;
    break;
    case MBT_WHEEL_DOWN:
    encstate = 0x41;
    wheel = TRUE;
    break;
    default:
    return;
    }
    if (wheel) {
    if (a != MA_CLICK)
    return;
    } else switch (a) {
    case MA_DRAG:
    if (term->xterm_mouse == 1)
    return;
    encstate += 0x20;
    break;
    case MA_RELEASE:
    if (!term->xterm_extended_mouse)
    encstate = 0x03;
    term->mouse_is_down = 0;
    break;
    case MA_CLICK:
    if (term->mouse_is_down == braw)
    return;
    term->mouse_is_down = braw;
    break;
    default:
    return;
    }
    if (shift)
    encstate += 0x04;
    if (ctrl)
    encstate += 0x10;
    r = y + 1;
    c = x + 1;

    if (term->xterm_extended_mouse) {
    len = sprintf(abuf, "\033[<%d;%d;%d%c", encstate, c, r, a == MA_RELEASE ? 'm' : 'M');
    } else if (term->urxvt_extended_mouse) {
    len = sprintf(abuf, "\033[%d;%d;%dM", encstate + 32, c, r);
    } else if (c <= 223 && r <= 223) {
    len = sprintf(abuf, "\033[M%c%c%c", encstate + 32, c + 32, r + 32);
    }

    *)

    --- Mystic BBS v1.12 A46 2020/05/17 (Windows/64)
    * Origin: Sector 7 | Mystic WHQ (1:129/215)
  • From Rob Swindell to g00r00 on Sunday, May 17, 2020 19:31:41
    Re: Re: Mouse support in Netrunner2 (or Mystic?)
    By: g00r00 to Rob Swindell on Sun May 17 2020 09:35 pm

    However, when testing with Netrunner2, an upper-left left-button click sends this:
    27 1b
    91 5b '['
    77 4d 'M'
    48 30 '0'
    41 29 ')'
    41 29 ')'

    What mouse protocol is this and do you have a reference document?

    Hey Rob,

    I'd be happy to (try to) help!

    The latest NetRunner is beta 19 which uses either XTERM(?) or maybe VT200(?) mouse support. I used whatever the default was in PUTTY at the time so that it'd be compatible with Mystic "out of the box".

    I have netrunner2 beta 18 which seems to still the latest available for download from http://mysticbbs.com/downloads.html. Is there some other download location for beta 19?

    I used to have a bookmark that had a reference but I can't seem to find it at the moment. I read through my code and I did have some source code notes that I can pass along, and a chunk of code from PUTTY that can be used as a reference to its various mouse modes.

    (Some observations that I just made by looking at my code:)

    (It looks like the X/Y coordinates are just the ascii character corresponding to the X/Y coordinate with with +32 added to it to avoid conflict with low ascii control characters.

    Right. So upper left should be "!!", not "))" as is being sent by Netrunner2 beta 18.

    So coordinates 1, 1 would be
    represented as Ascii#33;Ascii#33.

    Yup, that jives with xterm and the "X10 compatibilityi mode" in the relevant docs I've located.

    This means its limited to a terminal size
    of 223x223 though which is something I overlooked at the time.

    Which is why the SGR-extended encoding is preferred. You can combine SGR-extended encoding (esc[?1006h) with the other mouse protocol modes.

    It also
    looks like Mystic sends esc[?1000h to the Unix terminal when running in Unix to enable mouse reporting, so that seems like a clue we can Google to find out officially what it is.

    In that doc I referenced, that mode is called "Normal tracking mode". In that mode, the X and Y coordinates should be encoded as in the X10 mode we talked about above.

    NetRunner also translates a wheel spin to either
    the up or down arrow ANSI escape sequence for max usefulness with non-mouse-aware BBSes)

    Yup, noticed that. It's different than the standards, but works.

    digital man

    This Is Spinal Tap quote #41:
    Ian Faith: It say's "Memphis show cancelled due to lack of advertising funds." Norco, CA WX: 67.8°F, 69.0% humidity, 11 mph ENE wind, 0.00 inches rain/24hrs
  • From g00r00@1:129/215 to Rob Swindell on Sunday, May 17, 2020 22:45:53
    I have netrunner2 beta 18 which seems to still the latest available for download from http://mysticbbs.com/downloads.html. Is there some other download location for beta 19?

    Yes, and I don't know why but for whatever reason I just haven't updated the webpage for NetRunner in the past couple of years.

    You can get beta 19 at http://www.mysticbbs.com/downloads/prealpha/ there should be nr*.* files for Linux and Windows.

    I don't know when I switched over to whatever Mystic is using now but at one point Mystic's mouse was different than whatever it is doing now. Beta 19 would be the best bet. I'll have to get around to updating the website too.

    Yup, that jives with xterm and the "X10 compatibilityi mode" in the relevant docs I've located.

    This means its limited to a terminal size
    of 223x223 though which is something I overlooked at the time.

    Which is why the SGR-extended encoding is preferred. You can combine SGR-extended encoding (esc[?1006h) with the other mouse protocol modes.

    Makes sense. At the time I don't think 233x233 was even on my radar so I just used whatever Putty was sending out for compatibility.

    These days my screen IO library supports up to 65535 x 65535 (obviously untested lol) so I am not opposed to changing the mouse mode it uses to be
    more compatible.

    --- Mystic BBS v1.12 A46 2020/05/17 (Windows/64)
    * Origin: Sector 7 | Mystic WHQ (1:129/215)
  • From Rob Swindell to g00r00 on Sunday, May 17, 2020 20:39:06
    Re: Re: Mouse support in Netrunner2 (or Mystic?)
    By: g00r00 to Rob Swindell on Sun May 17 2020 10:45 pm

    I have netrunner2 beta 18 which seems to still the latest available for download from http://mysticbbs.com/downloads.html. Is there some other download location for beta 19?

    Yes, and I don't know why but for whatever reason I just haven't updated the webpage for NetRunner in the past couple of years.

    You can get beta 19 at http://www.mysticbbs.com/downloads/prealpha/ there should be nr*.* files for Linux and Windows.

    I don't know when I switched over to whatever Mystic is using now but at one point Mystic's mouse was different than whatever it is doing now. Beta 19 would be the best bet. I'll have to get around to updating the website too.

    Well I confirm that beta 19's mouse tracking sequences appear to match what I would expect (e.g. "esc[M !!" for for an upper-left corner left-button click). So that's definitely different from beta 18.

    Unfortunately, right-click and middle-click don't work (these are used, for example, in my Minesweeper game). But it's much better.

    Yup, that jives with xterm and the "X10 compatibilityi mode" in the relevant docs I've located.

    This means its limited to a terminal size
    of 223x223 though which is something I overlooked at the time.

    Which is why the SGR-extended encoding is preferred. You can combine SGR-extended encoding (esc[?1006h) with the other mouse protocol modes.

    Makes sense. At the time I don't think 233x233 was even on my radar so I just used whatever Putty was sending out for compatibility.

    These days my screen IO library supports up to 65535 x 65535 (obviously untested lol) so I am not opposed to changing the mouse mode it uses to be more compatible.

    Cool. Another thing I noticed in Netrunner2, the num pad keys always send the digits, never the cursor control (home/end/up/down/left/right) sequences, regardless of the NumLock status. Just thought I'd mention it,

    digital man

    Synchronet "Real Fact" #21:
    The first commericial sale of Synchronet was to Las Vegas Playground BBS (1992).
    Norco, CA WX: 63.1°F, 80.0% humidity, 4 mph E wind, 0.00 inches rain/24hrs
  • From g00r00@1:129/215 to Rob Swindell on Sunday, May 17, 2020 23:52:55
    Unfortunately, right-click and middle-click don't work (these are used, for example, in my Minesweeper game). But it's much better.

    The NetRunner UI uses right click pretty much everywhere, so I left those
    out.

    I can get them added in though, but I'd have to figure out how I want to
    adjust the UI stuff. Maybe I can use CTRL+right/left/middle for UI stuff and regular clicks for terminal events. Or vice versa.

    Mindsweeper is a great idea for a mouse-enabled game! Awesome!

    --- Mystic BBS v1.12 A46 2020/05/17 (Windows/64)
    * Origin: Sector 7 | Mystic WHQ (1:129/215)
  • From g00r00@1:129/215 to Rob Swindell on Sunday, May 17, 2020 23:55:22
    Cool. Another thing I noticed in Netrunner2, the num pad keys always
    send the digits, never the cursor control (home/end/up/down/left/right) sequences, regardless of the NumLock status. Just thought I'd mention it,

    I knew about that at one point and I just haven't fixed it. NetRunner has been severely neglected over the past few years.

    I'll make a note of it in the code and try to get that fixed up too when I go back and look at the mouse stuff.

    --- Mystic BBS v1.12 A46 2020/05/17 (Windows/64)
    * Origin: Sector 7 | Mystic WHQ (1:129/215)
  • From Ryan Fantus@1:218/820 to Rob Swindell on Monday, May 18, 2020 02:42:01
    Hey Rob,

    Totally OT from what you and g00r00 were discussing, but I spoke with Rick Parrish and he mentioned being able to pass inbound IP addresses with
    fTelnet. I did a terrible job relaying info to g00r00, but I noticed
    Synchronet has the ability to make use of this IP info. When I connect to my Mystic board through fTelnet it always appears to be my wss server,
    127.0.0.1. Any chance you can help shed light on how this works?

    --- Mystic BBS v1.12 A46 2020/04/13 (Linux/64)
    * Origin: monterey bbs (1:218/820)
  • From Rob Swindell to Ryan Fantus on Monday, May 18, 2020 13:26:37
    Re: Re: / fTelnet IP codes
    By: Ryan Fantus to Rob Swindell on Mon May 18 2020 02:42 am

    Hey Rob,

    Totally OT from what you and g00r00 were discussing, but I spoke with Rick Parrish and he mentioned being able to pass inbound IP addresses with fTelnet. I did a terrible job relaying info to g00r00, but I noticed Synchronet has the ability to make use of this IP info. When I connect to my Mystic board through fTelnet it always appears to be my wss server, 127.0.0.1. Any chance you can help shed light on how this works?

    Synchronet accepts the "LOCATION" and "LOCATION NUMBER" Telnet options from the client. fTelnet sends the client's IP address to the server using these options.

    digital man

    Sling Blade quote #3:
    Karl (re: killing Doyle): That second one just plum near cut his head in two. Norco, CA WX: 65.5°F, 81.0% humidity, 12 mph E wind, 0.00 inches rain/24hrs
  • From g00r00@1:129/215 to Ryan Fantus on Monday, May 18, 2020 20:02:51
    Totally OT from what you and g00r00 were discussing, but I spoke with
    Rick Parrish and he mentioned being able to pass inbound IP addresses
    with fTelnet. I did a terrible job relaying info to g00r00, but I noticed

    I did write the code to handle telnet send-location, but I haven't gotten around to installing fTelnet to test it with yet. I'll try to get that done sometime soon.

    --- Mystic BBS v1.12 A46 2020/05/17 (Windows/64)
    * Origin: Sector 7 | Mystic WHQ (1:129/215)
  • From g00r00@1:129/215 to Rob Swindell on Tuesday, May 19, 2020 02:04:42
    Cool. Another thing I noticed in Netrunner2, the num pad keys always
    send the digits, never the cursor control (home/end/up/down/left/right) sequences, regardless of the NumLock status. Just thought I'd mention it,

    Hey Rob just to let you know I updated NetRunner to honor numlock cursor controls for the arrows, insert, delete, home, end, pgup/down.

    I'll hopefully get around to some mouse updates for middle/right soon, and
    then I'll finally update the webpage with that version after like 3 years of not doing it lol.

    --- Mystic 10 More Cowbell Who Wants to be a $Millionaire$ Edition
    * Origin: Sector 7 | Mystic WHQ (1:129/215)
  • From Rob Swindell to g00r00 on Monday, May 18, 2020 23:38:11
    Re: Re: Mouse support in Netrunner2 (or Mystic?)
    By: g00r00 to Rob Swindell on Tue May 19 2020 02:04 am

    Hey Rob just to let you know I updated NetRunner to honor numlock cursor controls for the arrows, insert, delete, home, end, pgup/down.

    I'll hopefully get around to some mouse updates for middle/right soon, and then I'll finally update the webpage with that version after like 3 years of not doing it lol.

    Cool. Thank you!

    digital man

    Synchronet "Real Fact" #99:
    The Synchronet Wiki (wiki.synchro.net) went online in April of 2010.
    Norco, CA WX: 56.7°F, 85.0% humidity, 5 mph E wind, 0.00 inches rain/24hrs
  • From Ryan Fantus@1:218/820 to Rob Swindell on Tuesday, May 19, 2020 01:31:04
    Synchronet accepts the "LOCATION" and "LOCATION NUMBER" Telnet options from the

    client. fTelnet sends the client's IP address to the server using these options.

    Thanks!

    --- Mystic BBS v1.12 A46 2020/04/13 (Linux/64)
    * Origin: monterey bbs (1:218/820)
  • From Ryan Fantus@1:218/820 to g00r00 on Tuesday, May 19, 2020 01:31:58
    I did write the code to handle telnet send-location, but I haven't gotten around to installing fTelnet to test it with yet. I'll try to get that done sometime soon.

    Oh, sweet. Let me know if I can help!

    --- Mystic BBS v1.12 A46 2020/04/13 (Linux/64)
    * Origin: monterey bbs (1:218/820)
  • From Richard Miles@1:3634/24 to g00r00 on Tuesday, May 19, 2020 20:07:27
    On 19 May 2020, g00r00 said the following...

    Hey Rob just to let you know I updated NetRunner to honor numlock cursor controls for the arrows, insert, delete, home, end, pgup/down.


    Nice. Will have to go download. Was having problems testing some older
    software using doorway and it was crapping out because of the cursor
    controls. That may be the fix I was looking for.

    -=>Richard Miles<=-
    -=>Captain Obvious<=-
    -=>bbs.shadowscope.com<=-

    --- Mystic BBS v1.12 A46 2020/04/17 (Windows/32)
    * Origin: Shadowscope BBS | bbs.shadowscope.com | Temple, GA (1:3634/24)
  • From g00r00@1:129/215 to Richard Miles on Tuesday, May 19, 2020 22:12:48
    Hey Rob just to let you know I updated NetRunner to honor numlock cur controls for the arrows, insert, delete, home, end, pgup/down.

    Nice. Will have to go download. Was having problems testing some older software using doorway and it was crapping out because of the cursor controls. That may be the fix I was looking for.

    Unfortunately this may not be what you're looking for. All of those keys already function in Netrunner, this is just a fix to the numlock state.

    Unless you were specifically trying to use the number pad instead of the arrow keys/home/end/page keys, you probably won't experience anything different than you did before.

    --- Mystic BBS v1.12 A46 2020/05/19 (Windows/32)
    * Origin: Sector 7 | Mystic WHQ (1:129/215)
  • From Richard Miles@1:3634/24 to g00r00 on Wednesday, May 20, 2020 17:43:57
    On 19 May 2020, g00r00 said the following...

    Unless you were specifically trying to use the number pad instead of the arrow keys/home/end/page keys, you probably won't experience anything different than you did before.

    Yeah, unfortunately. Had to try it out.

    -=>Richard Miles<=-
    -=>Captain Obvious<=-
    -=>bbs.shadowscope.com<=-

    --- Mystic BBS v1.12 A46 2020/05/17 (Windows/32)
    * Origin: Shadowscope BBS | bbs.shadowscope.com | Temple, GA (1:3634/24)