[vlc-commits] windowed mac plugin: allow leaving fullscreen through a double click on the vout and respond to the space key the way we expect

Felix Paul Kühne git at videolan.org
Wed Jan 16 14:41:07 CET 2013


npapi-vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Jan 16 14:41:03 2013 +0100| [2cf75012325b592be25f94ab0cdf40929974d16f] | committer: Felix Paul Kühne

windowed mac plugin: allow leaving fullscreen through a double click on the vout and respond to the space key the way we expect

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=2cf75012325b592be25f94ab0cdf40929974d16f
---

 npapi/vlcplugin_mac.mm |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/npapi/vlcplugin_mac.mm b/npapi/vlcplugin_mac.mm
index bb9c1a9..01976a8 100644
--- a/npapi/vlcplugin_mac.mm
+++ b/npapi/vlcplugin_mac.mm
@@ -388,6 +388,9 @@ bool VlcPluginMac::handle_event(void *event)
             if (cocoaEvent->data.key.keyCode == 53) {
                 toggle_fullscreen();
                 return true;
+            } else if (cocoaEvent->data.key.keyCode == 49) {
+                playlist_togglePause();
+                return true;
             }
         }
         case NPCocoaEventKeyUp:
@@ -936,11 +939,24 @@ static CGImageRef createImageNamed(NSString *name)
             if (key == (unichar) 0x1b) {
                 self.cppPlugin->toggle_fullscreen();
                 return;
+            } else if (key == ' ') {
+                self.cppPlugin->playlist_togglePause();
+                return;
             }
         }
     }
     [super keyDown: theEvent];
 }
 
+- (void)mouseDown:(NSEvent *)theEvent
+{
+    if ([theEvent type] == NSLeftMouseDown && !([theEvent modifierFlags] & NSControlKeyMask)) {
+        if ([theEvent clickCount] > 1)
+            self.cppPlugin->toggle_fullscreen();
+    }
+
+    [super mouseDown: theEvent];
+}
+
 @end
 



More information about the vlc-commits mailing list