CocoaDev

Edit AllPages

I was working on a program like Pixen, but just to find the mouse’s X and Y. I wrote this code to detect mouse motion:

#import <Cocoa/Cocoa.h>

@interface MouseMovement : NSObject { NSPoint oldPos; NSThread *sensorThread; SEL targetCallSelector; id target; }

@interface MouseMovement()

@implementation MouseMovement

#pragma mark System Methods

@end