2

What are the best way(s) to do it? Can ffi, RubyCocoa, or MacRuby do it?

It seems like CGEventCreateMouseEvent or CGPostMouseEvent (deprecated) can be used.

Please give a working example. thanks.

Update: the title of this question updated...

nonopolarity
  • 146,324
  • 131
  • 460
  • 740

1 Answers1

1

In MacRuby your views can catch these events. Just look into the DotView example that comes with MacRuby.

class MyView < NSView 
  def mouseUp event
    puts convertPoint(event.locationInWindow, fromView:nil)
  end
end
Thomas R. Koll
  • 3,131
  • 1
  • 19
  • 26