Way to pass Rev mouse coords over net?

Monte Goulding monte at sweattechnologies.com
Thu Aug 21 00:39:00 EDT 2003


>
> My boss wants me to see if it's possible to write a Rev app that
> will allow him to be in NY on his laptop running a Rev app and
> moving his mouse over an image, and his subordinates would be
> back at the office here in VA (behind a firewall), seeing his
> mouse move over the image as he's on the phone pointing at
> elements on-screen.
>
> Right now, I have a Rev app that lets us both look at an image
> that's pulled from a central server (outside the firewall), while
> we're in different locations.  The part I'm not sure how to
> implement is the part that passes the X,Y coordinates of his
> mouse to the Rev apps that we're running.
>
> I'm sure I could write something that would write a text file to
> the server, but that would be incredibely slow.  I'm not up on
> server ports and socket communications, but I'd be willing to bet
> that's how Timbuktu does it.  I'd somehow need to set up a server
> outside the corporate firewall with a port open that
> sends/receives 2 coordinates (X,Y) and makes them available for
> the Rev clients behind the firewall to "poll" (receive) and them
> I'd set a graphic mouse to those coordinates.  Anyone think this
> is possible, or know how to set up a server to pass data like this?
>

Take a look at the simple chat stack on the contributor list.
A simple way to do it would be as follows:

Your boss's version uploads a text file containing the IP of his laptop.
Then opens a  port to accept connections: probably 80 is the easiest if he
doesn't have a personal web server. All the people behind the firewall check
the file for the IP then connect to the laptop. From there all you need to
do is have a mouseMove handler on your boss's laptop as follows:

on mouseMove x,y
  repeat for each line tLine in the openSockets
    write x,y to socket tLine
  end repeat
end mouseMove

Then for everyone behind the firewall you:

on readMouseLoc
  read from socket sSocket for 1 line with message setMouseLoc
  readMouseLoc
end readMouseLoc

on setMouseLoc pSocket,pLoc
  put pLoc
end sMouseLoc

Well... anyway that's a completely untested start ;-)

Cheers

Monte




More information about the use-livecode mailing list