aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdrian Robert2008-11-25 04:09:49 +0000
committerAdrian Robert2008-11-25 04:09:49 +0000
commit19454c0a2ae88842d3f7d333101cc3569816fd34 (patch)
tree2af050377bacbac6d93a6729fa6a8cca22f9a22e /src
parent762ed4ad331de46f01af61fb8d0445731d84b867 (diff)
downloademacs-19454c0a2ae88842d3f7d333101cc3569816fd34.tar.gz
emacs-19454c0a2ae88842d3f7d333101cc3569816fd34.zip
* nsterm.m (-otherMouseDown:, -otherMouseUp:, -otherMouseDragged): New EmacsView methods. (EV_UDMODIFIERS, EV_BUTTON): Add OtherMouse constants. Fixes bug #1048,1357,1414.
Diffstat (limited to 'src')
-rw-r--r--src/nsterm.m37
1 files 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;
263#define EV_UDMODIFIERS(e) \ 263#define EV_UDMODIFIERS(e) \
264 ((([e type] == NSLeftMouseDown) ? down_modifier : 0) \ 264 ((([e type] == NSLeftMouseDown) ? down_modifier : 0) \
265 | (([e type] == NSRightMouseDown) ? down_modifier : 0) \ 265 | (([e type] == NSRightMouseDown) ? down_modifier : 0) \
266 | (([e type] == NSOtherMouseDown) ? down_modifier : 0) \
266 | (([e type] == NSLeftMouseDragged) ? down_modifier : 0) \ 267 | (([e type] == NSLeftMouseDragged) ? down_modifier : 0) \
267 | (([e type] == NSRightMouseDragged) ? down_modifier : 0) \ 268 | (([e type] == NSRightMouseDragged) ? down_modifier : 0) \
269 | (([e type] == NSOtherMouseDragged) ? down_modifier : 0) \
268 | (([e type] == NSLeftMouseUp) ? up_modifier : 0) \ 270 | (([e type] == NSLeftMouseUp) ? up_modifier : 0) \
269 | (([e type] == NSRightMouseUp) ? up_modifier : 0)) 271 | (([e type] == NSRightMouseUp) ? up_modifier : 0) \
272 | (([e type] == NSOtherMouseUp) ? up_modifier : 0))
270 273
271#define EV_BUTTON(e) \ 274#define EV_BUTTON(e) \
272 ((([e type] == NSLeftMouseDown) || ([e type] == NSLeftMouseUp)) ? 0 : \ 275 ((([e type] == NSLeftMouseDown) || ([e type] == NSLeftMouseUp)) ? 0 : \
273 (([e type] == NSRightMouseDown) || ([e type] == NSRightMouseUp)) ? 2 : 1) 276 (([e type] == NSRightMouseDown) || ([e type] == NSRightMouseUp)) ? 2 : \
277 [e buttonNumber] - 1)
274 278
275/* Convert the time field to a timestamp in milliseconds. */ 279/* Convert the time field to a timestamp in milliseconds. */
276#ifdef NS_IMPL_GNUSTEP 280#ifdef NS_IMPL_GNUSTEP
@@ -4729,16 +4733,23 @@ if (NS_KEYLOG) NSLog (@"attributedSubstringFromRange request");
4729} 4733}
4730 4734
4731 4735
4732- (void)mouseUp: (NSEvent *)theEvent 4736- (void)rightMouseDown: (NSEvent *)theEvent
4733{ 4737{
4734 NSTRACE (mouseUp); 4738 NSTRACE (rightMouseDown);
4735 [self mouseDown: theEvent]; 4739 [self mouseDown: theEvent];
4736} 4740}
4737 4741
4738 4742
4739- (void)rightMouseDown: (NSEvent *)theEvent 4743- (void)otherMouseDown: (NSEvent *)theEvent
4740{ 4744{
4741 NSTRACE (rightMouseDown); 4745 NSTRACE (otherMouseDown);
4746 [self mouseDown: theEvent];
4747}
4748
4749
4750- (void)mouseUp: (NSEvent *)theEvent
4751{
4752 NSTRACE (mouseUp);
4742 [self mouseDown: theEvent]; 4753 [self mouseDown: theEvent];
4743} 4754}
4744 4755
@@ -4750,6 +4761,13 @@ if (NS_KEYLOG) NSLog (@"attributedSubstringFromRange request");
4750} 4761}
4751 4762
4752 4763
4764- (void)otherMouseUp: (NSEvent *)theEvent
4765{
4766 NSTRACE (otherMouseUp);
4767 [self mouseDown: theEvent];
4768}
4769
4770
4753- (void) scrollWheel: (NSEvent *)theEvent 4771- (void) scrollWheel: (NSEvent *)theEvent
4754{ 4772{
4755 NSTRACE (scrollWheel); 4773 NSTRACE (scrollWheel);
@@ -4818,6 +4836,13 @@ if (NS_KEYLOG) NSLog (@"attributedSubstringFromRange request");
4818} 4836}
4819 4837
4820 4838
4839- (void)otherMouseDragged: (NSEvent *)e
4840{
4841 NSTRACE (otherMouseDragged);
4842 [self mouseMoved: e];
4843}
4844
4845
4821- (BOOL)windowShouldClose: (id)sender 4846- (BOOL)windowShouldClose: (id)sender
4822{ 4847{
4823 NSEvent *e =[[self window] currentEvent]; 4848 NSEvent *e =[[self window] currentEvent];