Is it possible to send a keystroke via SSH? I want to be able to send CMD+F2 via ssh from/to Mac OSX. If not possible a mouse solution would also be good.
The reason I need this is because I only have one keyboard (but two mouse). 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 be able to use my mouse mouse on the original iMac would save me loads of trouble!