diff options
author | Jess VanDerwalker <washu@sonic.net> | 2012-04-04 15:23:49 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2012-04-05 11:41:48 -0700 |
commit | 0d196b8b47ad5980b2cd40aa648bd38ede135967 (patch) | |
tree | 2c15a7a00513cb0ac93e91b9be0d3c4e02186f3e | |
parent | ebc569e57cc832759a8565baa875127587db28a3 (diff) |
Commented out unnessary handlers. Removed tracking area (from milestone4-sendEvent branch on old repo).
-rw-r--r-- | src/xtoq/XtoqView.h | 1 | ||||
-rw-r--r-- | src/xtoq/XtoqView.m | 82 |
2 files changed, 37 insertions, 46 deletions
diff --git a/src/xtoq/XtoqView.h b/src/xtoq/XtoqView.h index fdd7b2e..00da270 100644 --- a/src/xtoq/XtoqView.h +++ b/src/xtoq/XtoqView.h @@ -39,7 +39,6 @@ SOFTWARE. NSPoint currentPoint; NSNotificationCenter * notificationCenter; - NSTrackingArea * trackingArea; } /** diff --git a/src/xtoq/XtoqView.m b/src/xtoq/XtoqView.m index 58d9dd5..cc2f784 100644 --- a/src/xtoq/XtoqView.m +++ b/src/xtoq/XtoqView.m @@ -40,14 +40,6 @@ initWithFrame:(NSRect)frame { notificationCenter = [NSNotificationCenter defaultCenter]; [[self window] flushWindow]; [self setNeedsDisplay:YES]; - - trackingArea = [[NSTrackingArea alloc] initWithRect:frame - options: (NSTrackingMouseEnteredAndExited | - NSTrackingMouseMoved - | NSTrackingActiveInKeyWindow) - owner:self userInfo:nil]; - [self addTrackingArea:trackingArea]; - } return self; } @@ -86,14 +78,14 @@ drawRect:(NSRect)dirtyRect { //This is necessary for accepting input. -- (BOOL) +/*- (BOOL) acceptsFirstResponder { return YES; } - (BOOL)acceptsMouseMovedEvents { return YES; -} +}*/ /*- (void)mouseEntered:(NSEvent *)theEvent { @@ -110,41 +102,41 @@ acceptsFirstResponder { /** * Capture keyboard events */ -- (void) -keyDown:(NSEvent *)theEvent { - NSDictionary * dictionary = [NSDictionary dictionaryWithObject:theEvent - forKey:@"1"]; - [notificationCenter postNotificationName:@"XTOQviewKeyDownEvent" - object:self - userInfo:dictionary]; -} - --(void) -mouseDown:(NSEvent *)mouseEvent { - CGFloat f = [self bounds].size.height; - NSNumber *n = [[NSNumber alloc] initWithFloat:f]; - //NSLog(@"mouseevent %i", [mouseEvent mouseLocation]->x); - // NSLog(@"mouse event bound %f location %f", CGRectGetHeight(bnd), [mouseEvent locationInWindow].y ); - NSMutableDictionary *twoInfoDict = [[NSMutableDictionary alloc] initWithCapacity:2]; - [twoInfoDict setObject:mouseEvent forKey:@"1"]; - [twoInfoDict setObject:n forKey:@"2"]; - - //NSLog(@"bound %f location %f", CGRectGetHeight(bnd), [mouseEvent locationInWindow].y ); - [notificationCenter postNotificationName:@"XTOQmouseButtonDownEvent" - object:self - userInfo:twoInfoDict]; -} - -- (void)mouseUp:(NSEvent *)theEvent { - CGFloat f = [self bounds].size.height; - NSNumber *n = [[NSNumber alloc] initWithFloat:f]; - NSMutableDictionary *twoInfoDict = [[NSMutableDictionary alloc] initWithCapacity:2]; - [twoInfoDict setObject:theEvent forKey:@"1"]; - [twoInfoDict setObject:n forKey:@"2"]; - [notificationCenter postNotificationName:@"XTOQmouseButtonReleaseEvent" - object:self - userInfo:twoInfoDict]; -} +// - (void) +// keyDown:(NSEvent *)theEvent { +// NSDictionary * dictionary = [NSDictionary dictionaryWithObject:theEvent +// forKey:@"1"]; +// [notificationCenter postNotificationName:@"XTOQviewKeyDownEvent" +// object:self +// userInfo:dictionary]; +// } + +// -(void) +// mouseDown:(NSEvent *)mouseEvent { +// CGFloat f = [self bounds].size.height; +// NSNumber *n = [[NSNumber alloc] initWithFloat:f]; +// //NSLog(@"mouseevent %i", [mouseEvent mouseLocation]->x); +// // NSLog(@"mouse event bound %f location %f", CGRectGetHeight(bnd), [mouseEvent locationInWindow].y ); +// NSMutableDictionary *twoInfoDict = [[NSMutableDictionary alloc] initWithCapacity:2]; +// [twoInfoDict setObject:mouseEvent forKey:@"1"]; +// [twoInfoDict setObject:n forKey:@"2"]; + +// //NSLog(@"bound %f location %f", CGRectGetHeight(bnd), [mouseEvent locationInWindow].y ); +// [notificationCenter postNotificationName:@"XTOQmouseButtonDownEvent" +// object:self +// userInfo:twoInfoDict]; +// } + +// - (void)mouseUp:(NSEvent *)theEvent { +// CGFloat f = [self bounds].size.height; +// NSNumber *n = [[NSNumber alloc] initWithFloat:f]; +// NSMutableDictionary *twoInfoDict = [[NSMutableDictionary alloc] initWithCapacity:2]; +// [twoInfoDict setObject:theEvent forKey:@"1"]; +// [twoInfoDict setObject:n forKey:@"2"]; +// [notificationCenter postNotificationName:@"XTOQmouseButtonReleaseEvent" +// object:self +// userInfo:twoInfoDict]; +// } - (void)setPartialImage:(NSRect)newDamageRect { [self setNeedsDisplayInRect:newDamageRect]; |