| 1 |
Configurable keybindings in nxagent |
| 2 |
|
| 3 |
Keybindings in the redistributed x2go version of nxagent can be configured |
| 4 |
by the user. This is done via a configuration file. |
| 5 |
|
| 6 |
File location |
| 7 |
------------- |
| 8 |
|
| 9 |
nxagent parses the first available configuration file and ignores all others. |
| 10 |
|
| 11 |
If nxagent is called without branding, it searches: |
| 12 |
- in the location given by the '-keystrokefile' command line parameter |
| 13 |
- in the location given by the NXAGENT_KEYSTROKEFILE environment variable |
| 14 |
- in ~/.nx/config/keystrokes.cfg |
| 15 |
- in /etc/nxagent/keystrokes.cfg |
| 16 |
|
| 17 |
If nxagent is called with X2Go branding (i.e., as x2goagent), it searches: |
| 18 |
- in the location given by the '-keystrokefile' command line parameter |
| 19 |
- in the location given by the X2GO_KEYSTROKEFILE environment variable |
| 20 |
- in ~/.x2go/config/keystrokes.cfg |
| 21 |
- in /etc/x2go/keystrokes.cfg |
| 22 |
|
| 23 |
If none of these files are accessible, the default configuration is used which |
| 24 |
is the same as the old, traditional nxagent keybindings. |
| 25 |
|
| 26 |
File format |
| 27 |
----------- |
| 28 |
|
| 29 |
The configuration file is XML with the following format: |
| 30 |
|
| 31 |
<!DOCTYPE NXKeystroke> |
| 32 |
<keystrokes> |
| 33 |
<keystroke action="fullscreen" AltMeta="1" Control="1" key="b" /> |
| 34 |
<keystroke action="minimize" AltMeta="1" Control="1" key="space" /> |
| 35 |
<keystroke action="minimize" key="Escape" Shift="1" /> |
| 36 |
<keystroke action="close_session" key="F7" /> |
| 37 |
<keystroke action="fullscreen" key="F7" Mod1="1" /> |
| 38 |
<keystroke action="fullscreen" key="F6" Mod1="1" /> |
| 39 |
<keystroke action="force_synchronization" key="f" /> |
| 40 |
<keystroke action="fullscreen" key="space" Mod1="0" Mod2="0" Control="0" Shift="0" AltMeta="0" /> |
| 41 |
</keystrokes> |
| 42 |
|
| 43 |
Each 'action' defines an action to be executed when receiving that |
| 44 |
keystroke. A list of possible actions is given below. Some of those |
| 45 |
actions are only available with debug builds of nxagent. |
| 46 |
|
| 47 |
Keys are given as a combination of 'key' and (optionally) a number of |
| 48 |
modifiers. The key attribute is evaluated into a X11 key via the usual |
| 49 |
XStringToKeysym function. A list of possible keys can be found in |
| 50 |
/usr/include/X11/keysymdef.h, the names are specified without the |
| 51 |
leading 'XK_'. Evaluation is case-sensitive, so, 'space' and 'Escape' |
| 52 |
will work while 'Space' and 'escape' won't. |
| 53 |
|
| 54 |
Modifiers are given as boolean attributes, possible modifiers are |
| 55 |
Mod1, Mod2, Mod3, Mod4, Mod5, Control, Shift, Lock. Sensible |
| 56 |
combinations strongly depend on your keyboard configuration, but |
| 57 |
usually you will need Mod1 and Control. Boolean in this context means |
| 58 |
'0', 'false' and an unspecified attribute are false, anything else is |
| 59 |
considered true. |
| 60 |
|
| 61 |
Everything in this file is case-sensitive. Unknown lines are ignored |
| 62 |
(accompanied by a warning in the session log). Keybindings are |
| 63 |
evaluated from top to bottom, so if a keybinding matches, other |
| 64 |
keybindings further down will be ignored. The contents of the file |
| 65 |
replaces the default keybindings, and only one file is read, no |
| 66 |
merging between different configuration files is done. This also means |
| 67 |
that an empty or invalid configuration file deactivates all |
| 68 |
keybindings. |
| 69 |
|
| 70 |
If an attribute occurs more than once in a line the last one wins. |
| 71 |
|
| 72 |
Some of the actions can open a dialog window. Depending on the user's |
| 73 |
answer the selected action will be taken. Some actions will only show |
| 74 |
a dialog informing the user about the taken action. All these dialogs |
| 75 |
will only work if the nxagent/x2goagent process has a properly |
| 76 |
configured NX_CLIENT environment variable pointing to an executable |
| 77 |
(like nxdialog) that is responsible for showing the dialogs and taking |
| 78 |
the action(s). If that executable cannot be run no dialog will show up |
| 79 |
and no action will be taken. |
| 80 |
|
| 81 |
List of possible 'action' attributes: |
| 82 |
------------------------------------- |
| 83 |
|
| 84 |
close_session |
| 85 |
This terminates the session. If a proper dialog helper is available |
| 86 |
ask the user if he wants to disconnect |
| 87 |
or terminate the session and then perform the selected |
| 88 |
action. Without proper helper it will do nothing (except writing an |
| 89 |
error the session log) |
| 90 |
|
| 91 |
fullscreen |
| 92 |
Switches the client window into or out of fullscreen mode, using |
| 93 |
only the current head. |
| 94 |
|
| 95 |
switch_all_screens |
| 96 |
Switches the client window into or out of fullscreen mode, using all |
| 97 |
available heads. |
| 98 |
|
| 99 |
minimize |
| 100 |
This will minimize the client window (even for fullscreen sessions). |
| 101 |
|
| 102 |
resize |
| 103 |
This action switches between the auto-resize (default) and viewport |
| 104 |
mode. In viewport mode the xserver screen size stays static even |
| 105 |
if the nxagent window is resized. You will possibly only see a part of |
| 106 |
the screen and can scroll around using the following actions: |
| 107 |
viewport_move_left/up/right/down |
| 108 |
Moves the viewport left/up/right/down by the width resp. height of |
| 109 |
the visible area. |
| 110 |
viewport_scroll_left/up/right/down |
| 111 |
Scrolls the viewport left/up/right/down with increasing speed |
| 112 |
(maximum step size is 200px). |
| 113 |
|
| 114 |
defer |
| 115 |
Activates/deactivates deferred screen updates. With a proper |
| 116 |
dialog helper (see above) it will open a dialog informing the user |
| 117 |
about the action taken. |
| 118 |
|
| 119 |
ignore |
| 120 |
Ignores the following keystroke, nothing will happen when this |
| 121 |
keystroke is pressed. The keystroke will NOT be passed to the |
| 122 |
clients. If you want the clients to see the keystroke you need to |
| 123 |
eliminate the line from the config file instead of using 'ignore'. |
| 124 |
|
| 125 |
reread_keystrokes |
| 126 |
Forces nxagent to re-read the keystroke configuration. Useful to |
| 127 |
add/change keystrokes to a running session. |
| 128 |
|
| 129 |
autograb |
| 130 |
Toggles autograb mode |
| 131 |
|
| 132 |
dump_clipboard |
| 133 |
print the current internal clipboard state (for debugging) to the |
| 134 |
log. |
| 135 |
|
| 136 |
force_synchronization |
| 137 |
Forces immediate drawing of elements to be synchronized which can |
| 138 |
fix some visual bugs. |