Don't send special keys in 10.6's Screen Sharing

01.01.2010
I use OS X's Screen Sharing a lot--with five Macs scattered about the house, it's often the easiest way to work on another machine. In Snow Leopard, Apple changed the handling of certain "special" keys--Command-Tab for the application switcher, Command-Option-Escape for the force quit dialog, and others--in Screen Sharing.

In OS X 10.5, these special keys were never sent to the remote Mac; they affected the machine on which you were running Screen Sharing, not the machine you happened to be controlling with Screen Sharing. In 10.6, though, these keys are always sent to the remote machine.

If you like to use Screen Sharing with the window maximized to cover the screen, this is problematic: how do you switch out of Screen Sharing if you can't use Command-Tab and you can't click on your local desktop? The short answer is you can't; you have to shrink the window and then click your local desktop.

Similarly, if you run multiple Screen Sharing sessions, you could switch between them in 10.5 by using Exposé's Application Windows mode. But in 10.6, the Exposé shortcuts are sent to the remote machine, so you'll have to use the Window menu in Screen Sharing to toggle between open sessions.

If you prefer the 10.5 behavior, wherein special keys are never sent to the remote Mac, there is a solution. It requires Terminal (in Applications -> Utilities), but only for one command. Launch Terminal, then copy and paste the following line (while Screen Sharing is not active):

defaults write com.apple.ScreenSharing DoNotSendSystemKeys -bool YES

From now on, when you start Screen Sharing, the "special" keys will be executed locally, instead of being sent to the remote Mac. In an ideal world, there'd be an easy way to specify on-the-fly where you'd like the keystrokes to go (i.e. "tap Command twice to send the next shortcut to the remote Mac"). Lacking that, though, I've opted to use this hint, as I most often want the special keys to be executed locally, not remotely.

If you'd like to revert to the standard behavior (sending the special keys), close any open Screen Sharing sessions, and then use Terminal to delete the key you added:

defaults delete com.apple.ScreenSharing DoNotSendSystemKeys

Note that this also works for the full-blown Apple Remote Desktop package--just change ScreenSharing to RemoteDesktop in the above commands. Thanks to contributor Douglas Hair for the Apple Remote Desktop version of this hint; I just used his work to figure out that you could do the same for Screen Sharing.