Knowledge Base
Searching in : Article
ID: AR12J00659
Applies to: NX Software
Added on: 2012-12-27
Last Update: 2014-05-09

How to disable NX key shortcuts in version 3.x

Some of you have asked how you can disable the keyboard shortcuts that NX uses. NX keyboard shortcuts are hardcoded and can't be changed individually, but you can disable them altogether in the nxagent component that runs on the host where you have the NX Server installed.


Here's how you can do it with a little bit of code hacking.

1) Download the nxagent source code from the sources page in the download section of the website.

2) Open and find the function nxagentCheckSpecialKeystroke()

3) In the file Keystroke.c, change the code to:

  *result = doNothing;

  return 0;

4) Save your new nxagent component as nxagent.disabled or something similar.

Build your new nxagent making sure you include the correct version of your modified nxagent. It is generally assumed that you will build in $HOME/NX on your Linux host.

To compile nxagent you need:
nxcomp-X.Y.Z-N.tar.gz
nxcompext-X.Y.Z-N.tar.gz
nxcompshad-X.Y.Z.tar.gz
nxproxy-X.Y.Z-N.tar.gz
nx-X11-X.Y.Z-N.tar.gz
nxauth-X.Y.Z-N.tar.gz
nxagent-X.Y.Z-N.tar.gz

Go to your ~/NX directory and untar all the previous files. The nx-X11 component is a modified X.Org distribution, so, as usual:

 > make World

This will also build nxcomp, nxcompext, nxcompshad and all the required libs in nx-X11.

Replace the nxagent component in NX Server. To do that you need to:

- go to the installation directory which is where you build your new nxagent:
cd /usr/NX/bin

- make a backup of the nxagent installed:
cp -a nxagent nxagent.bak

- copy the new nxagent component (the one you just built)
cp $HOME/NX/nx-X11/programs/Xserver/nxagent.disabled

And you're ready to go.