Table of Contents

Customize NX Keyboard Shortcuts

General Remarks

About this Wiki Page

This Wiki page is largely a copy of the README.keystrokes in http://code.x2go.org/gitweb?p=nx-libs.git;a=summary which in turn is a copy of the same file in NX (https://github.com/ArcticaProject/nx-libs/tree/3.6.x/doc/nxagent). Please keep them in sync.

About nxagent

nxagent is the process that an X2Go Server executes (under the name x2goagenbt). Therefore the configuration described below is evaluated on an X2Go Server and you have to place your configuration file on the server.

Configurable Key Bindings in nxagent

Key bindings in the redistributed X2Go version of nxagent (aka nx-libs, NX redistributed) can now be configured by the user. This is done via a configuration file.

File Location

nxagent parses the first available configuration file and ignores all others.

If nxagent is called without branding, it searches:

If nxagent is called with X2Go branding (i.e., as x2goagent), it searches:

If none of these files are accessible, the default configuration is used which is the same as the old, traditional nxagent keybindings.

File Format

The configuration file is XML with the following format:

keystroke.cfg
<!DOCTYPE NXKeystroke>
<keystrokes>
<keystroke action="fullscreen" AltMeta="1" Control="1" key="b" />
<keystroke action="minimize" AltMeta="1" Control="1" key="space" />
<keystroke action="minimize" key="Escape" Shift="1" />
<keystroke action="close_session" key="F7" />
<keystroke action="fullscreen" key="F7" Mod1="1" />
<keystroke action="fullscreen" key="F6" Mod1="1" />
<keystroke action="force_synchronization" key="f" />
<keystroke action="fullscreen" key="space" Mod1="0" Mod2="0" Control="0" Shift="0" AltMeta="0" />
</keystrokes>

Each 'action' defines an action to be executed when receiving that keystroke. A list of possible actions is given below. Some of those actions are only available with debug builds of nxagent.

Keys are given as a combination of 'key' and (optionally) a number of modifiers. The key attribute is evaluated into a X11 key via the usual XStringToKeysym function. A list of possible keys can be found in /usr/include/X11/keysymdef.h, the names are specified without the leading 'XK_'. Evaluation is case-sensitive, so, 'space' and 'Escape' will work while 'Space' and 'escape' won't.

Modifiers are given as boolean attributes, possible modifiers are Mod1, Mod2, Mod3, Mod4, Mod5, Control, Shift, Lock. Sensible combinations strongly depend on your keyboard configuration, but usually you will need Mod1 and Control. Boolean in this context means '0', 'false' and an unspecified attribute are false, anything else is considered true.

Everything in this file is case-sensitive. Unknown lines are ignored (accompanied by a warning in the session log). Keybindings are evaluated from top to bottom, so if a keybinding matches, other keybindings further down will be ignored. The contents of the file replaces the default keybindings, and only one file is read, no merging between different configuration files is done. This also means that an empty or invalid configuration file deactivates all keybindings.

If an attribute occurs more than once in a line the last one wins.

Some of the actions can open a dialog window. Depending on the user's answer the selected action will be taken. Some actions will only show a dialog informing the user about the taken action. All these dialogs will only work if the nxagent/x2goagent process has a properly configured NX_CLIENT environment variable pointing to an executable (like nxdialog) that is responsible for showing the dialogs and taking the action(s). If that executable cannot be run no dialog will show up and no action will be taken.

List of possible ''action'' attributes

Only in builds with certain debugging options enabled, ignored otherwise: