Loading ...
Sorry, an error occurred while loading the content.

Termcap mouse support

Expand Messages
  • Phillips, Steven
    There have been a few requests for mouse support within a UNIX console ME, I have looked into this and I am not convinced it would be of much use. Therefore
    Message 1 of 2 , Jul 26, 2006
    • 0 Attachment
      There have been a few requests for mouse support within a UNIX console ME, I have looked into this and I am not convinced it would be of much use. Therefore before I implement support I would like to be convinced that this is a worthwhile Endeavour.
       
      Mouse support in a UNIX console is not a standard, the closest (or most commonly used) is the XTerm interface. This interface is used by a console application enabling it (sending Termcap control string), once enabled any mouse button pick or drop event is translated into a terminal style key sequence, e.g.
       
          C-[ [ A       -> cursor up key
          C-[ [ 3 ~    -> Home key
       
          C-[ [ M " C R   -> Mouse pick right button (where C is the column & R is the row)
          C-[ [ M # C R   -> Mouse drop button
       
      All straight forward so far, but there are three serious limitations - firstly I have not found a way of interacting with the clip board, secondly this only works in an XTerm and thirdly there are no move events, only the pick and drop.
       
      - Not being able to get or set the clipboard is a real limitation, I typically only use the console version when I have a quick edit and that is usually to do something with text in the clipboard. Obviously the mouse could be used to select and yank text within ME, but you would not be able to get or put a text string to another app.
       
      - As this only works in an XTerm, you need an X display to get your xterm, so if you want to use a mouse in ME use the X version of ME!
       
      - The lack of move events would make the dragging of regions a fairly hit and miss affair.
       
      I can see the mouse support being useful in apps like a terminal file browser (commander) type app where you probably don't cut and paste text and theres no XTerm interface, but the only real benefit I can see for this in ME would be to help with the OSD dialogs. But given you would not want mouse support enabled by default and given this only works in an Xterm I think this is a really limited use case which will require the mouse by enabled (manually?) .
       
      What is the point? Thoughts welcome,
       
      Steve
    • Thomas Hundt
      If it s a choice between clipboard and mouse, I ll take the clipboard. Running mc -- Midnight Commander, which supports the mouse -- in a terminal window
      Message 2 of 2 , Jul 26, 2006
      • 0 Attachment
        If it's a choice between clipboard and mouse, I'll take the clipboard.

        Running 'mc' -- Midnight Commander, which supports the mouse -- in a
        terminal window seems to confirm it's either/or. Yes, the mouse would
        be useful for dealing with the OSD menus, but once I got the arrow keys
        working, all that became a lot easier to deal with.

        Re: "If you're running in an xterm, why not just run the GUI version" --
        the one word answer is "Putty". This is an excellent, free ssh terminal
        program that runs under Windows, and emulates most xterm features. (For
        example, termcap colors, app notification on resizing, and massive
        amounts of scrollback.) Best of all, for the user it looks the same,
        whether the target machine supports X11 or not.

        I use the console version of ME probably 25% of the time, on machines
        that either have a slow connection, or don't have the x11 libs installed
        (or x11 tunnelling disabled), or for quick edits that don't justify
        popping up Yet Another Window.

        -Th


        Phillips, Steven wrote:
        >
        > There have been a few requests for mouse support within a UNIX console
        > ME, I have looked into this and I am not convinced it would be of much
        > use. Therefore before I implement support I would like to be convinced
        > that this is a worthwhile Endeavour.
        >
        > Mouse support in a UNIX console is not a standard, the closest (or most
        > commonly used) is the XTerm interface. This interface is used by a
        > console application enabling it (sending Termcap control string), once
        > enabled any mouse button pick or drop event is translated into a
        > terminal style key sequence, e.g.
        >
        > C-[ [ A -> cursor up key
        > C-[ [ 3 ~ -> Home key
        >
        > C-[ [ M " C R -> Mouse pick right button (where C is the column &
        > R is the row)
        > C-[ [ M # C R -> Mouse drop button
        >
        > All straight forward so far, but there are three serious limitations -
        > firstly I have not found a way of interacting with the clip board,
        > secondly this only works in an XTerm and thirdly there are no move
        > events, only the pick and drop.
        >
        > - Not being able to get or set the clipboard is a real limitation, I
        > typically only use the console version when I have a quick edit and that
        > is usually to do something with text in the clipboard. Obviously the
        > mouse could be used to select and yank text within ME, but you would not
        > be able to get or put a text string to another app.
        >
        > - As this only works in an XTerm, you need an X display to get your
        > xterm, so if you want to use a mouse in ME use the X version of ME!
        >
        > - The lack of move events would make the dragging of regions a fairly
        > hit and miss affair.
        >
        > I can see the mouse support being useful in apps like a terminal file
        > browser (commander) type app where you probably don't cut and paste text
        > and theres no XTerm interface, but the only real benefit I can see for
        > this in ME would be to help with the OSD dialogs. But given you would
        > not want mouse support enabled by default and given this only works in
        > an Xterm I think this is a really limited use case which will
        > require the mouse by enabled (manually?) .
        >
        > What is the point? Thoughts welcome,
        >
        > Steve
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.