iMac Target Display mode, bluetooth keyboard and mouse

20130321-231629.jpg

When using an iMac as a secondary monitor for a macbook pro (target display mode), it is more comfortable to use the iMac’s keyboard and mouse rather than the MBPs, however this is not straight forward.

Method 1: Synergy

The keyboard and mouse are connected to the iMac, synergy is setup so that the pointer can pass from the iMac to the MBP. This works fine, right up until target display mode is enabled (cmd+f2), then the keyboard and mouse stop responding, even if the cursor was on the MBP screen at the time.

Method 2: Teleport

Same problems as synergy.

Method 3: Screen Sharing

This is rather ghetto but it works.

  1. Enable screen sharing on the iMac
  2. Disable bluetooth on the iMac
  3. Plug in mini-displayport/thunderbolt cable to start using iMac as external monitor.
  4. Enable bluetooth on MBP
  5. Turn keyboard and mouse off and on again (to enable discovery mode)
  6. Pair keyboard and mouse with MBP

To return keyboard and mouse to the iMac:

  1. Disable bluetooth on MBP
  2. Start screen sharing session to control iMac form MBP.
  3. Via screen sharing enable bluetooth on iMac

And there you have it, after 6(!!) easy steps, you can use the iMac’s display, keyboard and mouse with an MBP. Steps 5&6 are only required the first time.

Update: Steal mouse and keyboard with bash script.

The screen sharing thing is a bit tiresome, so I installed blueutil on both macs, setup ssh keys and wrote two very simple scripts to toggle bluetooth appropriately.