Settings

Theme

Magic Switch: Share Apple Magic keyboard/track-pad/mouse between two Macs

joshua.hu

85 points by chanux · 45 comments

Reader

15 threads
Terretta

Fwiw, this has been helpful for a couple decades now:

https://symless.com/synergy/features

Given that even a corp Mac can now (policy permitting) allow a personal AppleID along with the corporate login, it's easy enough to do the same with just native OS controls even with 2 logins. Something magical about opening an iPad next to a MacBook and pushing the cursor across ... or, alternatively, wirelessly (or USB-C) making the iPad an extended screen.

But Synergy remains great.

If free is your bag instead of supporting the nominal cost:

https://github.com/deskflow/deskflow

They explain this here:

https://symless.com/synergy/blog/how-to-use-synergy-for-free

  • netsharc

    That "for free" link isn't accurate at all, it claims you have to compile Deskflow yourself, but on Deskflow's Github they offer binary releases.

    I don't remember why Barrier was forked from Deskflow, but I've been using Barrier for many many years now. Now that I think of it, I do notice bugs, that maybe I should try out a new version to see if there are life improvements. E.g. with keyboard layouts, even when both systems are running Windows, the target system can be confused what character it should be outputing; and I need to hit "reload" to reconnect after returning one or both systems from standby, sometimes clipboard sharing also breaks.

    • nly

      Barrier was forked from Synergy many years ago

      Deskflow is just the open source version of Synergy (sans branding) released by Symless.

      The weird layout bugs are because of the way it all works behind the scenes. Non-control characters are sent as characters (not key codes) over the wire and then mapped back to local key codes on the receiving side.

    • MarceliusK

      The keyboard layout issue sounds nastier than the reconnect bug to me. Input forwarding gets surprisingly weird once keycodes, layouts, modifiers and the target OS's interpretation all get involved

  • threecheese

    As a paid Synergy user, there are tradeoffs (as you probably know). I'm willing to accept these for a side-by-side Mac workflow (or Mac + something else), where each host has a dedicated display.

    For a workflow where you are also display switching (kvm etc), Synergy doesn't work well. You can technically use it when hosts are coming on/off display, but it's not designed for it. If you use a kvm-like workflow and have a Magic Touchpad, there's no easy solution without re-pairing, and I hope OPs tool works for this.

    • j45

      Something like Synergy with an HDMI Matrix to allow the number of screens allocated to different computers to be changeable could be pretty interesting.

  • cosmic_cheese

    Years ago I used Synergy and derivatives, but at least back then wireless (as is often needed with at least one machine being a laptop without an ethernet connection or dock) performance was always disappointing, I think due to how it makes round trips through your network instead of using an ad-hoc P2P wifi connection like how Continuity built into macOS does.

  • MarceliusK

    Synergy is great, but I think this is solving a slightly different problem

  • opan

    First I remember hearing of deskflow, but I remember hearing about a synergy fork called "barrier". Is that not used anymore?

  • j45

    Thanks, I was trying to understand the difference between this and something like synergy.

    Apple also has their own Universal Control, that is semi-reliable from time to time. https://support.apple.com/en-ca/102459

  • LoganDark

    Love Deskflow. It has bugs with high-DPI displays on Windows. If the server is a Mac, you may need to launch it with an environment variable DESKFLOW_MOUSE_ADJUSTMENT based on the scale factor of the client.

    High-DPI bugs are some of my least favorite software bugs because people usually don't seem to care about them!! but they are so incredibly annoying and infuriating.

aaronbrethorst

The solution I settled on was swapping between my personal and work laptops with a thunderbolt cable that connects to a dock. The dock is connected to my keyboard, trackpad, webcam, and monitor. It’s been working like a champ for the past 3+ years.

  • asadjb

    I had a similar solution but got tired of swapping the cable b/w the two laptops. I found https://sabrent.com/products/sb-tb4k which keeps both machines connected and can switch b/w the two with a "switch button" which is connected to the KVM switch.

    This was the only KVM I found which connects to 2 Thunderbolt devices at once, everything else was relying on HDMI+USB3 for the host connection.

  • cosmic_cheese

    Been doing this for almost 6 years now, since the pandemic. It was the best solution that I could find at the time and though Thunderbolt switches have appeared since then, reviews have painted them as extremely flaky almost universally and their port selection is limited despite their exorbitant prices, so for the time being I'm going to keep cable-swapping.

    I've not had trouble with docks (all CalDigit) or cables failing, though the port on the dock has grown loose. It still works perfectly but can glitch out if I bump the dock (thankfully not common with how it's positioned at my desk).

    As nice as the USB-C connector is, for this use case I'd really like a connector that's USB-C electrically but bigger, bulkier, more robust… something like the old FireWire 400 connectors with their satisfying click would be great.

  • radley

    I've been using TB5-compatible magnetic USB adapters to switch between TB5 Macs. The keyboard, mouse, & hub all plug into my monitor.

    I used the Sabrent TB4 KVM for a while. I had to give it up and use the magnetic USB hack when my new gear outpaced the KVP switch (i.e. TB5 == 5K HDR @ 120Hz).

    If anyone here does try magnetic adapters, I highly recommend the 90° flat connectors, since they're far less prone to disconnect when you move the monitor.

  • ashley95

    I too very recently ran into the problem in the article, and like you, my solutionw as a thunderbolt dock.

    I would love however, to have the cordless magic accessoriers, as it keeps the desktop cleaner.

    Will give this tool a try if I can get away with installing it on my corp laptop (which forbids any kind of remote access/Synergy-style stuff).

    • a1o

      Apple keyboards and mouse are horrible, don’t bother with those, plenty of others exists that also have multiple cordless solutions (dongle, Bluetooth, WiFi). The only of the magic devices from apple that is worth is the touchpad, that one is really good, and yes it is usable with a mouse too, as some things are useful through gestures.

      • LoganDark

        Apple is one of the only ways to get a good chiclet keyboard as a peripheral. Wish there were one with the full laptop layout though, half-height arrows and all.

      • thenthenthen

        Yes!! The trackpad is amazing, sadly smashed mine (its glass on the top…). The keyboards are atrocious (why are the laptop keyboards better?) and the mice are just … design disasters from every perspective.

  • dcow

    Came to share this setup too, though I’ve managed to keep the doc in the monitor.

    Very neat and fun project though, and good to know there’s a nice solution if the need every arises.

  • jmyeet

    I was a long time user of CalDigit docks. Over a period of 3 years I think I had 3 fail. It's been a couple of years since I've used one in anger. We're onto TS5/TS5+. I think the last I used was the TS3+. But what I can say is... the technology just isn't there yet, for several reasons:

    1. I liked to use a Bluetooth headset. What I really want is to pair the headset (or microphone or whatever device) with the dock, not the computer. As a result, switching just didn't work. And Bluetooth is finnicky at the best of times. This was a pain point;

    2. The cables have a really high failure rate. I now buy at least 2 of any cable I buy because I expect one to be bad from the start or fail, particularly the cable between the Macbook and the dock. It has to carry power and a full TB load. 3 feet was best. 6 feet at the time was the longest it could go. I expect there have been teething problems with TB4/5 since. I'm actually curious about the Chinese GPMI standard/cable, as an aside;

    3. Thunderbolt itself was generally good because it's well-supported by OSX, including DRMA support. But passthrough for HDMI/DP still felt like it had problems. It should be bulletproof. There's nothing worse than a monitor that might go black occasionally and you don't know why;

    4. Generally speaking, handling this much bandwidth requires a lot of computing power. A dock is basically a 100G+ switch.

    • sirn

      > I liked to use a Bluetooth headset. What I really want is to pair the headset (or microphone or whatever device) with the dock, not the computer. As a result, switching just didn't work. And Bluetooth is finnicky at the best of times. This was a pain point;

      You can resolve this one with those dongle that did the pairing on the dongle itself, e.g. Sennheiser BTD-600/700. The device will appear on the host machine as a non-Bluetooth audio device.

Aaargh20318

Very useful tool. I’m using this in combination with BetterDisplay to switch between my personal and work laptop.

I have both hooked up to 2 monitors. A shortcut triggers MagicSwitch to switch my keyboard and mouse to the other machine, while it uses BetterDisplay to send a DDC command to the monitors that makes it switch inputs.

Bound the whole thing to a key combo, and now I can easily switch between two machines.

  • gmac

    I have something similar set up with a Logitech MX keyboard and mouse. I have the added constraint that one laptop is locked to a VPN and thus inaccessible on the local network.

    * Using the keyboard's switch-device button moves the keyboard to the other laptop.

    * Logitech's Options+ app automatically switches the mouse to the same device in response.

    * Claude vibe-coded me a native app that runs on both laptops and sends a DDC command to the monitor to switch inputs any time it detects keyboard and mouse both going away in quick succession: https://github.com/jawj/mxswitch

calini

Since I move a bunch of USB devices between my personal and work MacBooks anyway, I just wired my Magic Keyboard and Trackpad up to the same KVM switch and that works fine. However, it wouldn’t work for a Magic Mouse if I decided to use that, so I’ll give Magic Switch a try (especially compelling since it doesn’t require the same Apple ID as Continuity does). I’d like to see if I can wire it up to switch when the KVM switches from one laptop to the other.

MarceliusK

A lot of good software starts with refusing to tolerate one tiny annoyance and it's amazing in a way :)

Grombobulous

Apple could just have a multiple device pairing indicator and switch like every other keyboard/mouse manufacturer on the planet, but of course they’re not allowed to implement any convenience features that escape the need for the ecosystem.

nottorp

Hmm. I bought the cheapest kvm switch i could find (vga + 2 usb only) and ignored the vga ports for this. The advantage is it's cross platform.

Have to switch monitor inputs separately but it will do, considering the other box is running either windows or linux.

dzink

Yes, its also very annoying and has to be manually disabled if you don't want to constantly play "Where the hell is my cursor".

nathancahill

Doesn't Mac already do this natively?

zitterbewegung

Why should I use this when Universal Control is in macOS?

patriciobcs

Been using deskflow and works perfectly

diebillionaires

i use deskflow between two mac’s and a pc, but it doesn’t support trackpads. so this is nice for those users

cush

Isn’t this built into MacOS?

  • lukeify

    Not between Apple IDs. I use a paid product (ironically also called Magic Switch: https://www.magic-switch.com) to switch between my personal laptop and a few corporate laptops I have.

    Will give this free one a go, I think.

brcmthrowaway

Odd living in Poland as an expat - is there a tax break on crypto maybe?

ashley95

This is the kind of incredible stuff that I love seeing pop up lately due to a strong AI-assist.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection