Created
April 23, 2010 17:38
-
-
Save boucher/376864 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)mouseDragged:(NSEvent *)anEvent | |
{ | |
[NSEvent startPeriodicEventsAfterDelay:2.0 withPeriod:0.1]; | |
NSEvent *ev = nil; | |
BOOL continueTracking = YES; | |
do | |
{ | |
ev = [[self window] nextEventMatchingMask: NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSPeriodicMask]; | |
NSLog(@"PERIODIC EVENT: %@", ev); | |
switch ([ev type]) | |
{ | |
case NSLeftMouseDragged: | |
continueTracking = NO; | |
break; | |
case NSLeftMouseUp: | |
continueTracking = NO; | |
break; | |
case NSPeriodicMask: | |
[self autoscroll:anEvent]; | |
break; | |
} | |
} while (continueTracking); | |
[NSEvent stopPeriodicEvents]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment