I am working on a remote-controller, i.e. take one device (be it a Mac or a 
mobile client) and control another Mac. So the application runs in background 
and the events should be delivered to the front-most application.

Moving the mouse around works by posting the corresponding events, but I have a 
hard time to simulate key strokes.

I need to simulate the input of normal text as well as special keys like cursor 
keys, command, alt... I've tried CGEventCreateKeyboardEvent() but it is a real 
headache, as keycodes vary with every keyboard layout, making it virtually 
impossible to find a matching sequence of keycodes for a given String to type. 
Now, if there as a NSStringToKeyCodes method, that would be nice!

Next try was using AppleScript: tell application "System Events" to keystroke 
"The text"
Works well, but only limited: I just can't get special characters like "é" to 
work (while "ä" *does* work). 

So after doing research for several hours, I am left behind without a clue. 
There obviously is a way to do it, but I can't see it.

Please help :-) Thanks, Eiko

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to