Is it possible to send a keystroke via SSH? I want to be able to send ⌘ (CMD)+F2 via ssh from/to Mac OS X. If that's not possible, a mouse solution would also be good.
The reason I need this is because I have only one keyboard (but two mice). I use my iMac as external display. To activate the target display mode on the iMac I must connect the Bluetooth keyboard every time, hit CMD+F2, then try to get my laptop to connect to the keyboard.
Sending CMD+F2 via ssh or being able to use my mouse on the original iMac would save me loads of trouble!