About mouse controlling in c/c++

Vernon Cole vernondcole at gmail.com
Wed May 4 15:40:05 UTC 2011

On Date: Tue, 3 May 2011 12:37:05 -0400
From: Guannan Ma <mythmgn at gmail.com> wrote:
> [...]
> With putty, I can execute commands such like mplayer in order to play
> music when i am in my bed.
> The problem is putty cannot controll mouse directly.

Yes.  It's not really a C problem, it's a definition problem.

PuTTY and all other VTxx terminal emulators suffer from the same
problem -- the early VT series were never equipped with mice.  In the
early 90's there were a few emulators which had limited mouse support,
but it was never very well defined, so often either not supported or
not used. I searched in vain for an ANSI standard for the escape
sequences sent by mouse movements.  Today, I found a site which lists
the DEC private sequences that some of the later terminals sent and
received. It appears that you need to turn them on before they will
work. Try http://bjh21.me.uk/all-escapes/all-escapes.txt and see what
you can work out.

PuTTY may or may not obey any of these -- I've never looked at the
source code or found detailed documentation. Try a search for "putty
mouse" on Google.  Be prepared for a lot of work.

More information about the Ubuntu-devel-discuss mailing list