8

Here's my setup: MacBook --> Thunderbolt Display --> iMac 27"

The MacBook is the primary computer I want to use; the iMac is the (external) display.

This all works just fine. The problem is, when I disconnect and then reconnect the MacBook, I have to manually put the iMac in Target Display Mode using the keyboard. This means I need to keep a keyboard attached to the iMac, and it clutters up my desk!

Is there any way to switch the iMac into TDM without using the keyboard? Maybe by logging in remotely?

I found a few similar questions, but... no answers!

Is it possible to have an iMac maintain target display mode even through sleep/screensaver

Target Display Mode: how to automate and persist on closing laptop

Anyone?

  • 3
    osascript -e 'tell application "System Events" to key code 144 using command down' worked for me in Mavericks, but hasn't worked since updating my iMac to Yosemite. :| – Dougal May 5 '15 at 20:22
  • 1
    @Dougal, I just tried it and it worked on 10.10.4. – gk5885 Aug 19 '15 at 15:26
  • The osascript approach only works when there is a keyboard plugged in. – Abhi Beckert Mar 12 '17 at 22:06
3

I found a way to do it with an old, white apple keyboard, haven't tested with others but it might work.

I used a tool called Karabiner from https://pqrs.org/osx/karabiner/. When you install it, enable following options to get Command + F2 to work:

F1..F12 to Functional Keys (Brightness Adjust, Music Control, etc)
- F1,F2 to Brightness Adjust
--- F1 to Brightness Down
--- F2 to Brightness Up

After enabling this option, hit Command + F2 having previously connected your macbook using thunderbolt cable. If you're lucky you'll have a new external display working!

  • Karabiner fixed my problem, but not the specific one Stanislaw listed, it was the option listed under "For PC Keyboards" that worked in my case. There are many "F1..F12" options listed and you might need to try many of them before finding one that works. – Andrew Lavers May 28 '15 at 22:39
  • This worked great for me with a non-Apple keyboard. – Keith Kurak Jun 21 '16 at 1:30
2

VirtualKVM will allow you to use your "iMac as a monitor for [your] Macbook". This is super easy and free.

  • Just to say thanks, this is a very useful app! I'm also trying out 1Keyboard. – Matt Sephton Dec 6 '17 at 11:50
1

I was in that situation some time ago. The only way that seems to work without issuing the shortcut with Apple keyboard I found was this in Logitech forums.

I have successfully implemented what I believe is a reasonable workaround. Here's what I did...

Purchased and installed Keyboard Maestro from Stairways Software.

Within Keyboard Maestro I created a new Macro in the Global Macro Group.

For "Triggered by any of the following:" I selected "This device key:" and then hit the mute button (i.e. F10) on my Logitech keyboard. Keyboard Maestro correctly captured this as "USB Receiver Mute".

For "Will execute the following actions:" I had Keyboard Maestro record my keystrokes and then I hit ;-F2 USING MY APPLE KEYBOARD. Keyboard Maestro captured this as -? (I'm sure the ? is just a place holder). It looks odd, but it works.

Now when I hit the mute button (F10) I can enter AND EXIT Target Display Mode from my Logitech keyboard.

I originally tried another key (F15), but that didn't work for me. It allowed me to enter, but not exit, Target Display Mode. I suspect that this is due to the fact that your Mac ignores most all of the keys on the keyboard when in Target Display Mode. However, I knew it still "listened" to the keys that control music playback. I selected mute as it was the least offensive to use. I haven't tried any others yet.

But, this method as the author says in his following post, have a really nasty disadvantage:

Turns out the solution isn't perfect. After I took the batteries out of my Apple wireless keyboard, the mute/F10 trick on the Logitech keyboard stopped working. So, now I have the Apple wireless keyboard turned on, but not in use - the mute/F10 trick on the Logitech keyboard works again.

So, It's a pity, but the best method is to maintain and use the Apple keyboard.

  • I tested this solution and it works great if you're already using Maestro. The Karabiner option however doesn't require an apple keyboard (Karabiner is also free). – Andrew Lavers May 28 '15 at 22:42
0

Just a followup in case anyone still has problems even with the previous instructions. To my knowledge, this only applies to Logitech keyboards, although it might apply to others that have software (i.e. Logitech Control Center) controlling the functionality of the Function keys.

In this case, the software controlling the keyboard overrules Karabiner - in Logitech Control Center (LCC) this can be "fixed" by going to the "General" tab of the LCC keyboard settings and check the first checkbox: "When this box is checked, press F1, F2, etc. keys to use the standard function keys, and press and hold the Fn key to use the enhanced functions printed on the keys."

After checking that box the function keys are annoying to use - as it says you have to press them in conjunction with the "fn" key. BUT target display mode works like a charm if you've enabled F1/F2 brightness controls in Karabiner! As I use it rarely, I just leave the box unchecked so that the keyboard is more user friendly and then check it when I want to use TDM!

Hope this is helpful!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .