Extending a vnc client for programmatic access

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Extending a vnc client for programmatic access

Jordanna
Hi;

I'm looking to take an existing vnc viewer and extend it so that I can control it through programmatic access. Has anyone done anything like this, or is there any reason why this couldn't be done with TightVnc?

Essentially what I want is a vncApi, that has methods for clicking, typing, getting clipboard, and grabbing screenshots.  I want to be able to do this from java or c++. I'm not familiar with the TightVnc code base yet so any pointers/suggestions in regards to the feasibility or approaches I could take would be great.

~jordanna

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
VNC-Tight-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vnc-tight-devel
Reply | Threaded
Open this post in threaded view
|

Re: Extending a vnc client for programmatic access

Constantin Kaplinsky
Hello Jordanna,

>>>>> Jordanna wrote:

> Essentially what I want is a vncApi, that has methods for clicking, typing,
> getting clipboard, and grabbing screenshots.  I want to be able to do this
> from java or c++.

There is no such an API, but you can always get the TightVNC viewer
(native C++ or Java) and adapt it to your needs. Also it would be great
if you would then make your modifications available to other users.

--
With Best Wishes,
Constantin



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
VNC-Tight-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vnc-tight-devel
Reply | Threaded
Open this post in threaded view
|

Re: Extending a vnc client for programmatic access

Jeroen De Wachter
Constantin Kaplinsky wrote:

> Hello Jordanna,
>
>  
>>>>>> Jordanna wrote:
>>>>>>            
>
>  
>> Essentially what I want is a vncApi, that has methods for clicking, typing,
>> getting clipboard, and grabbing screenshots.  I want to be able to do this
>> from java or c++.
>>    
>
> There is no such an API, but you can always get the TightVNC viewer
> (native C++ or Java) and adapt it to your needs. Also it would be great
> if you would then make your modifications available to other users.
>
>  

I would certainly be interested in a VNC server that can be controlled
in this manner, so be sure to post any results :-)

Some things that might provide some alternatvies or point you in the
right direction: the XTest extension on the X Server allows simulated
pointer and keyboard events to be sent to an X Server (if the X Server
is equipped with the extension)
There is a tool called Xnee (http://www.gnu.org/software/xnee/) that is
able to record and to play back X Server interatcion. I believe Xnee
uses the XTest extension for the playback part.

you could get a screenshot by performing a XGetImage or XShmGetImage
call on the root X Window.
I'm going to look into posting some sample code here on how to do that
(if you are not interested, let me know, so I don't have to go through
the trouble).

Getting the clipboard data might be trickier with standard X Server
functionality though, but should be do-able with a fairly simple hook in
the VNC server code (just get the clipboard info right before it is sent
to the clients) or in the VNC client (get the info right after it's been
received).

Taking all this into account, it might still be very worthwhile to have
a common tool for all this. I think it should be relatively
straightforward (but likely taking quite a bit of work) to modify a VNC
client to do this kind of stuff (you could even omit the graphical
output on the client if you don't want it). The program could simply
pose as a standard VNC client to the server so the server doesn't have
to be modified...

Kind regards,

Jeroen De Wachter

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
VNC-Tight-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vnc-tight-devel