Here’s an idea for how to do this with one keypress. Say that you have Mac A and Mac B that are on the same local network (mac-a.local
and mac-b.local
) and you want them to share a keyboard (named Keyboard in ToothFairy):
-
Go to System Preferences ‣ Sharing and enable Remote Apple Events.
-
On Mac A, use ToothFairy’s Run shell script after connecting/disconnecting preference to set a disconnection script:
#!/usr/bin/osascript tell application "ToothFairy" of machine "eppc://user:password@mac-b.local" set device "Keyboard"'s connected to true end tell
You’ll need to fill in your username, password, and Bonjour name.
-
On Mac B, set a disconnection script:
#!/usr/bin/osascript tell application "ToothFairy" of machine "eppc://user:password@mac-a.local" set device "Keyboard"'s connected to true end tell
Now, whenever you disconnect the keyboard on one Mac, it will use AppleScript over the network to tell the other Mac to connect to it.