Alex Rivera | Logout

Global Mouse Moved Events in Cocoa

Asked 2009-10-27T01:55:07.127
10

Is there a way to register for global mouse moved events in Cocoa? I was able to register for the events using Carbon's InstallEventHandler(), but would prefer a Cocoa equivalent. I have looked for NSNotificationCenter events, but there doesn't seem to be any public event names (are there private ones?)

Alternatively, is there a way to use NSTrackingArea for views with a clearColor background?

The app is Snow Leopard only.

Edit
Report

1 Answer

3

If you want to track the mouse no matter where it is, you want a CGEventTap. There is no Cocoa equivalent. If you just want to track it in your application then you should explain why you're finding yourself unable to do so a little more thoroughly.

answered 2009-10-27T02:17:29.080

Your Answer