changeset 99917:d7ec854f5dc4

* nsterm.m (-otherMouseDown:, -otherMouseUp:, -otherMouseDragged): New EmacsView methods. (EV_UDMODIFIERS, EV_BUTTON): Add OtherMouse constants. Fixes bug #1048,1357,1414.
author Adrian Robert <Adrian.B.Robert@gmail.com>
date Tue, 25 Nov 2008 04:09:49 +0000
parents 99af427b4d7f
children d6617fc229b7
files src/nsterm.m
diffstat 1 files changed, 34 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/nsterm.m	Tue Nov 25 03:52:14 2008 +0000
+++ b/src/nsterm.m	Tue Nov 25 04:09:49 2008 +0000
@@ -263,14 +263,18 @@
 #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,6 +4733,20 @@
 }
 
 
+- (void)rightMouseDown: (NSEvent *)theEvent
+{
+  NSTRACE (rightMouseDown);
+  [self mouseDown: theEvent];
+}
+
+
+- (void)otherMouseDown: (NSEvent *)theEvent
+{
+  NSTRACE (otherMouseDown);
+  [self mouseDown: theEvent];
+}
+
+
 - (void)mouseUp: (NSEvent *)theEvent
 {
   NSTRACE (mouseUp);
@@ -4736,13 +4754,6 @@
 }
 
 
-- (void)rightMouseDown: (NSEvent *)theEvent
-{
-  NSTRACE (rightMouseDown);
-  [self mouseDown: theEvent];
-}
-
-
 - (void)rightMouseUp: (NSEvent *)theEvent
 {
   NSTRACE (rightMouseUp);
@@ -4750,6 +4761,13 @@
 }
 
 
+- (void)otherMouseUp: (NSEvent *)theEvent
+{
+  NSTRACE (otherMouseUp);
+  [self mouseDown: theEvent];
+}
+
+
 - (void) scrollWheel: (NSEvent *)theEvent
 {
   NSTRACE (scrollWheel);
@@ -4818,6 +4836,13 @@
 }
 
 
+- (void)otherMouseDragged: (NSEvent *)e
+{
+  NSTRACE (otherMouseDragged);
+  [self mouseMoved: e];
+}
+
+
 - (BOOL)windowShouldClose: (id)sender
 {
   NSEvent *e =[[self window] currentEvent];