macOS: Command key intercepted by Java menu accelerators, cannot be sent to VNC session as Meta/Alt

3 views
Skip to first unread message

John Ruttenberg

unread,
Feb 19, 2026, 1:35:07 PM (12 days ago) Feb 19
to TurboVNC User Discussion/Support
 Environment:    
  - TurboVNC Viewer v3.3 (build 20260206), macOS, connecting to TurboVNC 3.3 server on Ubuntu 20.04
  - Mac display: 3840x2160
  - Full-screen mode with -DesktopSize Auto -Tunnel

  Problem:

  On macOS, the Command key is intercepted by Java's menu accelerator system before TurboVNC's keyboard handling can
  process it. This means Command-key combinations are never sent to the VNC session.

  This is a blocker for emacs users on macOS who rely on Command as Meta (e.g., Cmd-X for M-x). This is the standard
  muscle memory for Mac emacs users ? in many cases, decades of it.

  Specific issues:

  1. Cmd-X triggers "Tile All Viewer Windows" instead of sending Meta-X to the VNC session. This is in the Connection
  menu.
  2. GrabKeyboard=Always does not help ? Java intercepts Cmd before the grab takes effect.
  3. NoHotkeys=1 does not help ? menu accelerators are separate from TurboVNC's hotkey system.
  4. Other VNC viewers (e.g., RealVNC Viewer) handle this correctly, sending Command as Alt/Meta to the VNC session.

  Expected behavior:

  When the viewer window is focused (especially in full-screen mode), Command-key combinations should be sent to the VNC
  session as Alt/Meta, not consumed by the viewer's Java menu bar. At minimum, there should be a configuration option to
  control this behavior.

  Workaround attempted:

  Karabiner-Elements can remap Command to Option at the OS level per-application, but requiring a third-party kernel
  extension to work around a key mapping issue is not ideal.

DRC

unread,
Feb 19, 2026, 2:08:52 PM (12 days ago) Feb 19
to turbovn...@googlegroups.com

There is a separate parameter (NoMacHotkeys) for disabling the macOS menu accelerators.  Referring to https://github.com/TurboVNC/turbovnc/issues/162, this takes care of all of the Command- key combinations except for:

Command-Q
Command-Comma
- If such is desired, I can probably intercept and transmit these as well whenever NoMacHotkeys is set.

Command-Space
- This can be disabled under System Settings-->Keyboard-->Keyboard Shortcuts-->Spotlight.

Command-Tab
Command-H
- Not much I can do about these without extending the TurboVNC Viewer's keyboard grabbing feature to macOS, and thus far my attempts at that have been unsuccessful.  (Refer also to
https://github.com/TurboVNC/turbovnc/issues/162.)

DRC

--
You received this message because you are subscribed to the Google Groups "TurboVNC User Discussion/Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to turbovnc-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/turbovnc-users/d7bc7428-fa5c-4211-a29c-607e6c2b98ddn%40googlegroups.com.

John Ruttenberg

unread,
Feb 19, 2026, 5:10:22 PM (12 days ago) Feb 19
to turbovn...@googlegroups.com
Command-Q would be especially good to intercept.  It's an emacs keybinding from when dinosaurs ruled the earth.  Command-H is very unfortunate.  It's also an ancient emacs keybinding.

You received this message because you are subscribed to a topic in the Google Groups "TurboVNC User Discussion/Support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/turbovnc-users/L9AQZ1Q0Qao/unsubscribe.
To unsubscribe from this group and all its topics, send an email to turbovnc-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/turbovnc-users/157f76ca-83b8-41da-bd20-e6fc0151038a%40virtualgl.org.

DRC

unread,
Feb 21, 2026, 6:30:11 AM (10 days ago) Feb 21
to turbovn...@googlegroups.com

It is possible to remap the accelerator in System Settings-->Keyboard-->Keyboard Shortcuts-->App Shortcuts.  (Add TurboVNC Viewer as an app, "Hide VncViewer" as a menu title, then select a key combination other than Command-H.)  In practice, however, this doesn't prevent macOS from intercepting Command-H.  :(  macOS keyboard grabbing is the best solution, but I spent a lot of time trying to figure it out and failed.  The TigerVNC Viewer has such a feature, but porting their implementation into the TurboVNC Viewer didn't work for some reason.  If someone else wants to look into it, I'm happy to share my progress so far.

John Ruttenberg

unread,
Feb 21, 2026, 10:24:14 AM (10 days ago) Feb 21
to TurboVNC User Discussion/Support
I could not even find TurboVNC Viewer in the applications list for keyboard app shortcuts.

DRC

unread,
Feb 21, 2026, 10:48:42 AM (10 days ago) Feb 21
to turbovn...@googlegroups.com

You have to click "Other" and select it manually.  Maybe the problem is that it needs to register itself with the operating system in some way, but I have no idea how to do that.

Reply all
Reply to author
Forward
0 new messages