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.
@Paul: Have you had this issue also with older version of KRDC? What VNC server are you connected to?
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.
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).
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.
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.
A possibly relevant merge request was started @ https://invent.kde.org/network/krdc/-/merge_requests/11
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
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