Open GoogleCodeExporter opened 8 years ago
Index: WLMouseBehaviorManager.m =================================================================== --- WLMouseBehaviorManager.m (revision 832) +++ WLMouseBehaviorManager.m (working copy) @@ -175,7 +175,24 @@ return nil; } - +- (void)swipeWithEvent:(NSEvent *)event { + CGFloat x = [event deltaX]; + CGFloat y = [event deltaY]; + BOOL directionHori = fabs(x)>fabs(y); + if (directionHori) { + if (x > 0) { + [_view sendText:termKeyLeft]; + } else { + [_view sendText:termKeyRight]; + } + } else { + if (y > 0) { + [_view sendText:termKeyPageUp]; + } else { + [_view sendText:termKeyPageDown]; + } + } +} #pragma mark - #pragma mark Add/Remove Tracking Area - (BOOL)isMouseInsideRect:(NSRect)rect { Index: WLTerminalView.m =================================================================== --- WLTerminalView.m (revision 832) +++ WLTerminalView.m (working copy) @@ -492,6 +492,11 @@ #pragma mark - #pragma mark Event Handling +- (void)swipeWithEvent:(NSEvent *)event { + [self hasMouseActivity]; + [self clearSelection]; + [_mouseBehaviorDelegate swipeWithEvent:event]; +} - (void)selectWordAtPoint:(NSPoint)point { NSRange range = [self rangeForWordAtPoint:point]; _selectionLocation = range.location; @@ -896,7 +901,7 @@ } else if (aSelector == @selector(insertTabIgnoringFieldEditor:)) { // Now do URL mode switching [self switchURL]; } else { - NSLog(@"Unprocessed selector: %s", aSelector); + NSLog(@"Unprocessed selector: %@", NSStringFromSelector(aSelector)); } }
Original issue reported on code.google.com by zhangchnxp on 10 Nov 2011 at 8:14
zhangchnxp
Original issue reported on code.google.com by
zhangchnxp
on 10 Nov 2011 at 8:14