When bug 3417 was implemented, the functionality was restricted to fullscreen mode. This is difficult from how rdesktop works (which was given in the initial description). Also, NoMachine has an option "Grab the keyboard when the client has focus" (http://www.nomachine.com/documents/configuration/client-guide.php), and customers have requested this functionality.
One use case for this feature is the ability to switch windows in the remote session. On some client platforms (ie Linux), it is sometimes possible to remap so that two different keyboard combinations are used, ie Alt-Tab switches windows locally while Super-Tab (Windows key) switches windows in the remote session. Unfortunately, this does not work on Windows clients, since the key has different uses on that platforms.
There is another suggestion regarding this on the TigerVNC mailing list:
Fixed in upstream vncviewer:
(In reply to comment #4)
> Fixed in upstream vncviewer:
Unclear if this upstream fix "solves" this bug.
This bug is about grabbing keyboard out of fullscreen mode.
This is not currently possible on macOS, given the current method of grabbing the keyboard.
However there is an alternative method, using "event taps" (see CGEventTap). It seems to provide the functionality we need, but the downside is that it requires some user interaction to activate (which is sensible given the possible problems low level event access can cause).
There is an old API, AXIsProcessTrusted(), that allows us to check if we can do what we want. There is also a newer event, AXIsProcessTrustedWithOptions(), that will notify and help the user if we are not "trusted".
We also need to check how this system behaves with our dual bundle design, as the "trust" is associated with a bundle.
The current keyboard grabbing method is also causing other issues, like bug 7160.