[vlc-commits] gtk: toggle play/pause with the space bar in fullscreen

Ludovic Fauvet git at videolan.org
Tue Jan 1 18:39:09 CET 2013


npapi-vlc | branch: master | Ludovic Fauvet <etix at videolan.org> | Thu Dec 27 19:06:24 2012 +0100| [6a19320e70bb877e05c841a1116c9d87b0d8ab54] | committer: Ludovic Fauvet

gtk: toggle play/pause with the space bar in fullscreen

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

 npapi/vlcplugin_base.h  |    4 ++++
 npapi/vlcplugin_gtk.cpp |    3 +++
 2 files changed, 7 insertions(+)

diff --git a/npapi/vlcplugin_base.h b/npapi/vlcplugin_base.h
index be7b21c..a7441f2 100644
--- a/npapi/vlcplugin_base.h
+++ b/npapi/vlcplugin_base.h
@@ -97,6 +97,10 @@ public:
     int      b_stream;
     char *   psz_target;
 
+    void playlist_toggle_play_pause()
+    {
+        playlist_isplaying() ? playlist_pause() : playlist_play();
+    }
     void playlist_play()
     {
         get_player().play();
diff --git a/npapi/vlcplugin_gtk.cpp b/npapi/vlcplugin_gtk.cpp
index 38c2df7..2e13de0 100644
--- a/npapi/vlcplugin_gtk.cpp
+++ b/npapi/vlcplugin_gtk.cpp
@@ -364,6 +364,9 @@ static gboolean fullscreen_win_keypress_handler(GtkWidget *widget, GdkEventKey *
     VlcPluginGtk *plugin = (VlcPluginGtk *) user_data;
     switch (event->keyval)
     {
+    case GDK_KEY_space:
+        plugin->playlist_toggle_play_pause();
+        return True;
     case GDK_KEY_Escape:
         plugin->set_fullscreen(false);
         return True;



More information about the vlc-commits mailing list