Skip to content

Instantly share code, notes, and snippets.

@freynaud
Created July 14, 2011 12:33
Show Gist options
  • Save freynaud/1082364 to your computer and use it in GitHub Desktop.
Save freynaud/1082364 to your computer and use it in GitHub Desktop.
context :
trying to send event to an app in the background ( safari ).
Started from this example : http://www.cocoabuilder.com/archive/cocoa/234233-send-click-to-window.html
and this
http://src.chromium.org/svn/trunk/src/chrome/browser/automation/ui_controls_mac.mm
the event generation is in
https://github.com/freynaud/MacOSNativeEvent/blob/master/MacOSNativeEvent/EventFactory.m
The glue around is to launch safari, find the PID, the windowID.
Problems :
issue 1 : if the mouseDown event is modifier is just 0
modifierFlags:0 , nothing happens.
modifierFlags:0 | NSCommandKeyMask works, but that's a Command + click. I want a simple click.
issue 2 :
drag and drop works ( command drag and drop due to 1 ), generating
mouseDown
moudragged, mouseDragged
mouseUp
but mouseMove doesn't work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment