summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authornplourde <nplourde@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-08-18 22:46:29 +0000
committernplourde <nplourde@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-08-18 22:46:29 +0000
commite627303d70bb28e7c1d283bf7fdbb0b6479a631c (patch)
treed2f0cd090d75572830e052bc33a5199b2b893ab4 /libvo
parent4166de18ec814d174817c8e379bfdc761c5195f0 (diff)
downloadmpv-e627303d70bb28e7c1d283bf7fdbb0b6479a631c.tar.bz2
mpv-e627303d70bb28e7c1d283bf7fdbb0b6479a631c.tar.xz
added double click support in vo_macosx. Patch by Ulion <ulion2002@gmail.com>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24097 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_macosx.h3
-rw-r--r--libvo/vo_macosx.m35
2 files changed, 33 insertions, 5 deletions
diff --git a/libvo/vo_macosx.h b/libvo/vo_macosx.h
index 2a6365cfe4..04a2381e54 100644
--- a/libvo/vo_macosx.h
+++ b/libvo/vo_macosx.h
@@ -73,8 +73,11 @@
- (void) keyDown: (NSEvent *) theEvent;
- (void) mouseMoved: (NSEvent *) theEvent;
- (void) mouseDown: (NSEvent *) theEvent;
+- (void) mouseUp: (NSEvent *) theEvent;
- (void) rightMouseDown: (NSEvent *) theEvent;
+- (void) rightMouseUp: (NSEvent *) theEvent;
- (void) otherMouseDown: (NSEvent *) theEvent;
+- (void) otherMouseUp: (NSEvent *) theEvent;
- (void) scrollWheel: (NSEvent *) theEvent;
- (void) mouseEvent: (NSEvent *) theEvent;
- (void) check_events;
diff --git a/libvo/vo_macosx.m b/libvo/vo_macosx.m
index e3aa5c894a..b8bc32dc96 100644
--- a/libvo/vo_macosx.m
+++ b/libvo/vo_macosx.m
@@ -947,16 +947,31 @@ static int control(uint32_t request, void *data, ...)
[self mouseEvent: theEvent];
}
+- (void) mouseUp: (NSEvent *) theEvent
+{
+ [self mouseEvent: theEvent];
+}
+
- (void) rightMouseDown: (NSEvent *) theEvent
{
[self mouseEvent: theEvent];
}
+- (void) rightMouseUp: (NSEvent *) theEvent
+{
+ [self mouseEvent: theEvent];
+}
+
- (void) otherMouseDown: (NSEvent *) theEvent
{
[self mouseEvent: theEvent];
}
+- (void) otherMouseUp: (NSEvent *) theEvent
+{
+ [self mouseEvent: theEvent];
+}
+
- (void) scrollWheel: (NSEvent *) theEvent
{
if([theEvent deltaY] > 0)
@@ -967,11 +982,21 @@ static int control(uint32_t request, void *data, ...)
- (void) mouseEvent: (NSEvent *) theEvent
{
- switch( [theEvent buttonNumber] )
- {
- case 0: mplayer_put_key(MOUSE_BTN0);break;
- case 1: mplayer_put_key(MOUSE_BTN1);break;
- case 2: mplayer_put_key(MOUSE_BTN2);break;
+ if ( [theEvent buttonNumber] >= 0 && [theEvent buttonNumber] <= 9 )
+ {
+ switch([theEvent type])
+ {
+ case NSLeftMouseDown:
+ case NSRightMouseDown:
+ case NSOtherMouseDown:
+ mplayer_put_key((MOUSE_BTN0 + [theEvent buttonNumber]) | MP_KEY_DOWN);
+ break;
+ case NSLeftMouseUp:
+ case NSRightMouseUp:
+ case NSOtherMouseUp:
+ mplayer_put_key(MOUSE_BTN0 + [theEvent buttonNumber]);
+ break;
+ }
}
}