On 2006-06-06 22:00:51 +0200, Ola Lundqvist wrote:
> I do not realize is this a problem? Should it not behave like this?

I'm not sure. Perhaps, as this is harmless for most applications.
But in this case, a VNC client should cope with that.

> If you do the same, but with vncviewer instead (ssh still to get the
> events), what do you get then? Is it something else?

I get the same thing, so that vncviewer thinks that the modifiers
(thus the modifiers in the VNC desktop) are still pressed when I
switch to a virtual terminal... until I go back to the X server.
But the big difference is that the VNC desktop can be shared and
the keyboard state is server-side, not client-side. So, if I use
the same VNC desktop from another machine before going back to
the X server on the original machine, then the modifiers (of the
VNC desktop) are still seen as pressed, and this is wrong.

> This is what I expect from the system:
> * You press Ctrl-Meta-F2
> * Ctrl-Meta is marked as set in X
> * Switch to console
> * Console check current key status and set it
> * You do things, which means that you probably need to lift your
>   keys and thus everything should work as expected.
> * You switch back Ctrl-F7
> * X check current key status and thus release Meta but keep Ctrl as
>   you are pressing that currently.
> 
> If the system behave in some other way it may be correct but
> quite likely not.

It could be more logical that when X loses the control of the keyboard
(because the user has switched to a virtual terminal), it should release
all the keys by sending KeyRelease events. Unfortunately, it doesn't.

> It may be so that vnc actually take over all control of the keyboard
> from X and then it is up to vnc to do this kind of things. So my
> question is now:

No, vncviewer does exactly what the X server tells it through KeyPress
and KeyRelease events. My problem shows that this is not the correct
behavior. This means that either the behavior of the X server needs to
be changed (unlikely, IMHO) or vncviewer needs to look at some other X
events.

There's the VisibilityNotify event with state VisibilityFullyObscured.
But I'm not sure whether vncviewer should send key release events to
the VNC server whenever the window gets fully obscured. Perhaps the X
protocol allows to get the necessary information.

-- 
Vincent Lefèvre <[EMAIL PROTECTED]> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

Reply via email to