Kyle Oliveira
Kyle Oliveira

Reputation: 197

Track Mouse Position in an Application without Nib

I'm making a Cocoa application and I wanna implement a Screen Hot Corners System (Just like Exposé Active Corners). My application don't have a Nib file and It'll run at the background. I wanna know how to constantly track mouse position, in order to know if the cursor reaches one of the screen corners, to invoke a method. Could someone help me? 本当にありがとうございました。

Upvotes: 3

Views: 215

Answers (1)

一二三
一二三

Reputation: 21289

Create a CGEventTap for the events you're interested in (probably just kCGEventMouseMoved).

Upvotes: 3

Related Questions