This article summarizes the keys and key combinations you need to press in order to achieve the result you expect if you are connecting to or from a Mac.
If you are connecting to a Mac from a Windows or Linux PC or vice versa, the two computers will likely have different keyboards. Some keys will be unique, and some keys with the same name perform will perform different functions. For example, the key marked “Alt” on modern Macs (also known as the “Option” key) performs a different function to the “Alt” key on PC keyboards. (It is most similar to the “AltGr” key on non-US PC keyboards.) Consequently, the Mac’s “Option/Alt” key is not mapped to the “Alt” keysyms over the RFB protocol. This marks a compatibility break with VNC Enterprise Edition 4.4 and earlier.
Definitions: On this page, a Mac’s “Option/Alt” key is referred to as Opt. Suffixes L and R refer to the left and right variants of keys. Alt refers to the “Alt” key on a PC, Win to the “Windows” key (represented by the Super
keysyms over the RFB protocol), and Cmd to the “Command” key on a Mac.
Connecting Mac to non-Mac
Controlling a Mac from a PC keyboard
To emulate on a Mac... | From a US PC keyboard, press... | From a non-US PC keyboard, press... |
---|---|---|
Cmd | AltL or Win | AltL or Win |
Opt | AltR | AltGr |
Opt+Cmd | AltR+Win or AltL+Win | AltL+Win |
From a US PC keyboard, AltR+<char> will be interpreted on the Mac to give extended characters.
From a non-US PC keyboard, AltGr+<char> will be interpreted on the PC where possible, so some Mac extended characters may be unavailable. A similar restriction occurs across other VNC Servers - the solution is to either switch to a keyboard layout on the VNC Viewer computer that is capable of producing the required character, or to use the Special Characters dialog, available from the Edit menu of most Mac applications.
If you need to specifically press the left or right Cmd key, AltL maps to CmdL and Win (L or R) to CmdR. OptR can only be produced by changing the parameters from their defaults.
Controlling a PC keyboard from a Mac
To emulate on a PC keyboard... | From a Mac keyboard, press... |
---|---|
AltL | CmdL |
WinL | CmdR |
AltR and WinR can only be produced by changing the parameters from their defaults. Opt on the Mac will be interpreted locally to produce extended characters, but will also send the ISO_Level3_Shift
keysym for OptL, and for OptR. These keysyms are typically bound to the AltGr key in the X Window system. ISO_Level3_Shift
is typically used by newer X installations, Mode_switch
by older ones.
Connecting ‘new’ Mac to ‘old’ Mac
Controlling a Mac running VNC 4.4 or earlier from 5.x+
To emulate on 4.4 or earlier... | From a 5.x+ keyboard, press... |
---|---|
CmdL | CmdR |
OptL | CmdL |
Opt+Cmd | CmdR+CmdL |
CmdR and OptR can only be produced by changing the parameters from their defaults.
Controlling a Mac running VNC 5.x+ from 4.4 or earlier
To emulate on 5.x+... | From a 4.4 or earlier keyboard, press... |
---|---|
CmdL | Cmd or OptL |
OptL | OptR (with SendExtendedCharacters option off) |
OptL+CmdL | CmdL+CmdR (but see caveat below) |
CmdR and OptR can only be produced by changing the parameters from their defaults. Pressing CmdL+CmdR will send keysym presses that are interpreted as Opt+Cmd. However, because of a VNC Viewer issue, one of the CmdL or CmdR keys will be left ‘stuck’ down. You will need to press and release this key before continuing.
VNC Connect parameters
Parameter | Default value |
---|---|
LeftCmdKey | Alt_L |
LeftOptKey | ExtendedChars |
RightCmdKey | Super_L |
RightOptKey | ExtendedChars |
The parameters are the same for VNC Viewer and VNC Server. Each parameter specifies which keysym should be generated (VNC Viewer) or interpreted (VNC Server) for the given key on the Mac keyboard. ExtendedChars
means that the key should be used to generate extended characters, and will also send the ISO_Level3_Shift
keysym (or the Mode_switch
keysym for OptR).
Comments
I want to map left cmd key to left ctrl key while in vncviewer application, how can I do that?
yes exactly. I'm too. So i can use the same shortcuts on the Mac and on the connected Windows-machine.
My solution is to bind LeftCmdKey to Super_L (Windows-Key) and run the following AutoHotkey 2.0 Script on the Windows-machine.
Please sign in to leave a comment.