On Thu, 30 Apr 2009, Daniel P. Berrange wrote:

It is also not, in general, possible to mandate that key repeat
takes place on the client. Where VNC the server is attached to
a X server / other desktop service, it might be possible to disable
server side repeat, but in the case of a VNC server attached to
a virtual machine this is impossible. The VNC server has no control
over how the X server inside the guest deals with key presses.

In this case, wouldn't it be possible for the VNC server to simulate a
KeyRelease after the KeyPress?

How would the VNC server know how long to wait before simulating the
KeyRelease to the guest operating system ? The server does not know
whether the client is about to send another KeyRelease of its own,
or whether it is going to send an second KeyPress.

I must admit that I basically is thinking out loud here, but: In the case you are talking about, how about simulating the KeyRelease immediately? The server can remember the simulated press and cancel out the one that the client sends later, if it is at all a problem for the OS to recieve KeyPress-KeyRelease-KeyRelease.

I think that we need to separate the communication between the VNC client and server, and the communication between the VNC server and the OS or virtual machine. I believe that the design that Pierre outlined should work pretty well for the VNC part. Server-side autorepeat, VNC wise, will never work reliably, so that's why we shouldn't depend on it. And by recommending the "down" approach, VNC servers will be able to tell the difference between autorepeat and manual key repeats. With this information, VNC servers will be in a better position to deliver the keyboard events to the OS or the virtual machine in the best possible way. If the VNC server has full control over the "desktop", it can disable server side autorepeat and propagate the VNC events directly to the desktop environment. But if the VNC server basically tries to simulate a physical keyboard, and cannot disable autorepeat, it can use simulated KeyReleases instead. If my mind is with me, the main drawback would be that the OS in this case cannot tell the difference between a autorepeat and manual repeat, but that's probably ok. Plus that applications might see a KeyRelease before the physical key is released, of course. Special handling will be required for modifiers, but in any case, the VNC server is in a much better position than the client to implement magic that's suitable for the machine or desktop it is controlling.

Best regards, ---
Peter Åstrand           ThinLinc Chief Developer
Cendio AB               http://www.cendio.com
Wallenbergs gata 4
583 30 Linköping        Phone: +46-13-21 46 00
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
tigervnc-rfbproto mailing list
tigervnc-rfbproto@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-rfbproto

Reply via email to