Bug 329951 - when connecting to a remote host, some modifier key (shift, or alt) is permanently pressed
Summary: when connecting to a remote host, some modifier key (shift, or alt) is perman...
Status: RESOLVED FIXED
Alias: None
Product: krdc
Classification: Applications
Component: VNC (other bugs)
Version First Reported In: 4.11.3
Platform: Debian testing Linux
: NOR major
Target Milestone: ---
Assignee: Urs Wolfer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-14 10:02 UTC by Paul Pogonyshev
Modified: 2021-02-18 22:21 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Pogonyshev 2014-01-14 10:02:23 UTC
Moreover, this sometimes changes as krdc is running. E.g. if you Alt+Tab to its window, sometimes (but not always) Alt sticks to remote host as well. It seems to be possible to "unstick" Alt by pressing/releasing it, but not with Shift (though note that I have Shift+RShift shortcut switching keyboard layout both locally and on remote machine, which complicates the matter).

Basically, this makes krdc completely unusable for me and I have to use simple vncviewer.

Reproducible: Sometimes

Steps to Reproduce:
There seems to be no reliable way to reproduce, but it happens in some 80% of cases of starting krdc here.
Comment 1 Urs Wolfer 2014-01-15 20:07:23 UTC
@Paul: Have you had this issue also with older version of KRDC? What VNC server are you connected to?
Comment 2 Paul Pogonyshev 2014-01-15 22:30:43 UTC
Sorry, I don't know because I only used VNC from another machine with a very old system (which I cannot upgrade) and there is no krdc there, only simple TightVNC. I wanted to use something more modern now, but with krdc I just ran into this problem with modifier keys.

Will try to check VNC server version tomorrow.
Comment 3 Paul Pogonyshev 2014-01-16 17:29:44 UTC
The VNC server on the machine I connect to is 0.9.8.2 (at least Fedora's yum tells so, I couldn't find how to query the server program for version).
Comment 4 Robin Green 2014-04-09 14:48:33 UTC
This also happens with the RDC protocol. My guess is that what is happening is that the key down event is sent, but when some key (such as Alt+Tab, or a kwin window shortcut) causes another local window to be switched to, KRDC doesn't send/receive the key up event for any modifier keys that were pressed down, so they appear to the remote machine to be still stuck down until you press those modifier key(s) once again.
Comment 5 Sektor van Skijlen 2019-12-02 10:02:14 UTC
This bug is still observed with krdc version 18.12.3 (current latest I'm using).

The key release for Alt/Control and other similar is indeed not delivered to the application when the Alt-Tab is pressed to switch to another application - BUT THE LOST FOCUS EVENT STILL IS.

I'd be really glad to use krdc instead of tigervnc - but this bug is so annoying that I really don't have a choice.
Comment 6 Bug Janitor Service 2021-02-18 10:37:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/krdc/-/merge_requests/11
Comment 7 Robert Hoffmann 2021-02-18 22:18:04 UTC
Git commit 7558fc24428aca06bea8f218516553307fb8b66d by Robert Hoffmann.
Committed on 18/02/2021 at 10:16.
Pushed by aacid into branch 'master'.

Unpress modifiers on focusOutEvent in VncView

Key combinations like Alt-Tab, Alt-F2, Alt-F3, Alt-F4 or Ctrl-Alt-Delete are
not effective on the remote desktop but local. The remote desktop looses its
focus but pressed modifier keys like Alt, Ctrl, Shift, Meta,... stay pressed,
rendering the remote desktop unusable.

This patch releases the modifier keys on focus loss.

Test: Press key combinations with modifier keys and check that the remote desktop
stays usable, e.g. while connected to a remote desktop, type some text into a
terminal or text application, then press Alt-Tab to change focus to a different
local window. Press Alt-Tab again to switch back to krdc and type some text again.

Without this patch, the Alt modifier is still active on the remote side and typing
text will fail. With the patch applied typing is successful.

Try other modifiers, too, e.g press the Ctrl-key, hold it and mouseclick some other
local window to get focus. Release the Ctrl-key and mouseclick krdc again. Do the
typing test.

Enable KRDC.debug logging and check the "VncView::unpressModifiers key=" message.

M  +11   -1    vnc/vncview.cpp
M  +1    -0    vnc/vncview.h

https://invent.kde.org/network/krdc/commit/7558fc24428aca06bea8f218516553307fb8b66d
Comment 8 Albert Astals Cid 2021-02-18 22:21:29 UTC
Git commit a02b82fc67114f296c9b05234615c5be086a8206 by Albert Astals Cid, on behalf of Robert Hoffmann.
Committed on 18/02/2021 at 22:20.
Pushed by aacid into branch 'release/20.12'.

Unpress modifiers on focusOutEvent in VncView

Key combinations like Alt-Tab, Alt-F2, Alt-F3, Alt-F4 or Ctrl-Alt-Delete are
not effective on the remote desktop but local. The remote desktop looses its
focus but pressed modifier keys like Alt, Ctrl, Shift, Meta,... stay pressed,
rendering the remote desktop unusable.

This patch releases the modifier keys on focus loss.

Test: Press key combinations with modifier keys and check that the remote desktop
stays usable, e.g. while connected to a remote desktop, type some text into a
terminal or text application, then press Alt-Tab to change focus to a different
local window. Press Alt-Tab again to switch back to krdc and type some text again.

Without this patch, the Alt modifier is still active on the remote side and typing
text will fail. With the patch applied typing is successful.

Try other modifiers, too, e.g press the Ctrl-key, hold it and mouseclick some other
local window to get focus. Release the Ctrl-key and mouseclick krdc again. Do the
typing test.

Enable KRDC.debug logging and check the "VncView::unpressModifiers key=" message.
(cherry picked from commit 7558fc24428aca06bea8f218516553307fb8b66d)

M  +11   -1    vnc/vncview.cpp
M  +1    -0    vnc/vncview.h

https://invent.kde.org/network/krdc/commit/a02b82fc67114f296c9b05234615c5be086a8206