# HG changeset patch # User nplourde # Date 1187477189 0 # Node ID 9ce03980ed0c181842520e1571ce2b2c6f15edb4 # Parent 7ac48ed8c39442e5681b2da8a968cb0b990db365 added double click support in vo_macosx. Patch by Ulion diff -r 7ac48ed8c394 -r 9ce03980ed0c libvo/vo_macosx.h --- a/libvo/vo_macosx.h Sat Aug 18 10:30:15 2007 +0000 +++ b/libvo/vo_macosx.h Sat Aug 18 22:46:29 2007 +0000 @@ -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 -r 7ac48ed8c394 -r 9ce03980ed0c libvo/vo_macosx.m --- a/libvo/vo_macosx.m Sat Aug 18 10:30:15 2007 +0000 +++ b/libvo/vo_macosx.m Sat Aug 18 22:46:29 2007 +0000 @@ -947,16 +947,31 @@ [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 @@ - (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; + } } }