11
4
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!
1
On the right path. What I tried was
– iDev247 – 2013-01-24T00:27:42.063osascript -e 'tell application "System Events" to key code 120 using command down';
. It generally works and can send keys but when it comes to CMD+F2 it doesn't appear to work/enable Target Display Mode. Is the command correct? Is there any other way to enable Target Display mode with mouse or command? Found key codes hereI was able to do it with http://www.keyboardmaestro.com/main/... I wonder what it sends as command to make it work.
– iDev247 – 2013-01-24T00:51:15.620I don't have an apple keyboard, could you share your macro if possible? Recording Cmd-F2 using my filco does not switcj. – Florian Doyon – 2013-11-09T15:04:35.917