How to transmit locally entered modifier keys or shortcuts to the remote desktop via VNC? Mask or escape them somehow

escapingkeyboard shortcutsvncvnc-viewerxmonad

I am connected to a xmonad desktop but am only able to use the first workspace. How can I change to other workspaces?

Furthermore: If the last terminal is closed, I can’t do anything. How can I open a new terminal? The problem is, that my local xmonad catches the keystrokes.

Generally speaking

  • Is there some magic key combination (shortcut) to circumvent the
    locally absorbed keystrokes, that is to escape the local shortcut to
    be able to send them to the remote VNC desktop? I mean something
    similar to screen, where you can press Ctrl+a
    a to submit a simple Ctrl+a to
    screen’s subprocess.

  • Or is there a way to enable and disable kbd capturing, as known from
    virtual machines’ visual interfaces? I mean like the right Ctrl key in
    virtualbox.

If that is of any interest: I am using x11vnc as the server and vncviewer from tigervnc (tightvnc) as the client/viewer. But I would change both of them, if that helps.

Best Answer

Ok, I stumbled over a hint in the man page, which I seem to have overseen before. The F8 key is the magic key: F8 opens a popup window where you can select Ctrl or Alt modifier to be locked. Then I can just press a number for a different workspace and then again F8 to unlock the Alt modifier.

Unfortunately other modifiers are not selectable. But that already helps.


Citing the man page from tiger vncviewer which is common for Red Hat, CentOS, Fedora, …:

POPUP MENU
       The viewer has a popup menu containing entries which perform various actions.  It is usually
       brought up by pressing F8, but this can be configured with the MenuKey  parameter.   Actions
       which the popup menu can perform include:

         * switching in and out of full-screen mode

         * quitting the viewer

         * generating key events, e.g. sending ctrl-alt-del

         * accessing the options dialog and various other dialogs

       By  default, key presses in the popup menu get sent to the VNC server and dismiss the popup.
       So to get an F8 through to the VNC server simply press it twice.

Citing the man page from tight vncviewer which is common for Debian, Ubuntu, … (much shorter description):

You  can  use  F8 to display a pop-up utility menu. Press F8 twice to pass single F8 to the
remote side.
Related Question