From 19454c0a2ae88842d3f7d333101cc3569816fd34 Mon Sep 17 00:00:00 2001 From: Adrian Robert Date: Tue, 25 Nov 2008 04:09:49 +0000 Subject: [PATCH] * nsterm.m (-otherMouseDown:, -otherMouseUp:, -otherMouseDragged): New EmacsView methods. (EV_UDMODIFIERS, EV_BUTTON): Add OtherMouse constants. Fixes bug #1048,1357,1414. --- src/nsterm.m | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index d8b4f60aba7..a82937a6ccf 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -263,14 +263,18 @@ static BOOL inNsSelect = 0; #define EV_UDMODIFIERS(e) \ ((([e type] == NSLeftMouseDown) ? down_modifier : 0) \ | (([e type] == NSRightMouseDown) ? down_modifier : 0) \ + | (([e type] == NSOtherMouseDown) ? down_modifier : 0) \ | (([e type] == NSLeftMouseDragged) ? down_modifier : 0) \ | (([e type] == NSRightMouseDragged) ? down_modifier : 0) \ + | (([e type] == NSOtherMouseDragged) ? down_modifier : 0) \ | (([e type] == NSLeftMouseUp) ? up_modifier : 0) \ - | (([e type] == NSRightMouseUp) ? up_modifier : 0)) + | (([e type] == NSRightMouseUp) ? up_modifier : 0) \ + | (([e type] == NSOtherMouseUp) ? up_modifier : 0)) #define EV_BUTTON(e) \ ((([e type] == NSLeftMouseDown) || ([e type] == NSLeftMouseUp)) ? 0 : \ - (([e type] == NSRightMouseDown) || ([e type] == NSRightMouseUp)) ? 2 : 1) + (([e type] == NSRightMouseDown) || ([e type] == NSRightMouseUp)) ? 2 : \ + [e buttonNumber] - 1) /* Convert the time field to a timestamp in milliseconds. */ #ifdef NS_IMPL_GNUSTEP @@ -4729,16 +4733,23 @@ if (NS_KEYLOG) NSLog (@"attributedSubstringFromRange request"); } -- (void)mouseUp: (NSEvent *)theEvent +- (void)rightMouseDown: (NSEvent *)theEvent { - NSTRACE (mouseUp); + NSTRACE (rightMouseDown); [self mouseDown: theEvent]; } -- (void)rightMouseDown: (NSEvent *)theEvent +- (void)otherMouseDown: (NSEvent *)theEvent { - NSTRACE (rightMouseDown); + NSTRACE (otherMouseDown); + [self mouseDown: theEvent]; +} + + +- (void)mouseUp: (NSEvent *)theEvent +{ + NSTRACE (mouseUp); [self mouseDown: theEvent]; } @@ -4750,6 +4761,13 @@ if (NS_KEYLOG) NSLog (@"attributedSubstringFromRange request"); } +- (void)otherMouseUp: (NSEvent *)theEvent +{ + NSTRACE (otherMouseUp); + [self mouseDown: theEvent]; +} + + - (void) scrollWheel: (NSEvent *)theEvent { NSTRACE (scrollWheel); @@ -4818,6 +4836,13 @@ if (NS_KEYLOG) NSLog (@"attributedSubstringFromRange request"); } +- (void)otherMouseDragged: (NSEvent *)e +{ + NSTRACE (otherMouseDragged); + [self mouseMoved: e]; +} + + - (BOOL)windowShouldClose: (id)sender { NSEvent *e =[[self window] currentEvent]; -- 2.39.2