changeset 34349:6e4af5500f8f

Add Return key events to playlist's file lists. This helps when operating the GUI with a remote control (and doesn't harm if not).
author ib
date Sun, 11 Dec 2011 17:51:24 +0000
parents be4236a5186c
children 27dead7f2593
files gui/ui/gtk/playlist.c
diffstat 1 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/gtk/playlist.c	Sun Dec 11 17:12:55 2011 +0000
+++ b/gui/ui/gtk/playlist.c	Sun Dec 11 17:51:24 2011 +0000
@@ -279,7 +279,22 @@
                                GdkEventKey * event,
                                gpointer user_data )
 {
- if (event->keyval == GDK_Return) plButtonReleased( NULL, user_data );
+ if (event->keyval == GDK_Return)
+  {
+   if ( GTK_WIDGET_TYPE( widget ) == GTK_TYPE_BUTTON ) plButtonReleased( NULL, user_data );
+   else
+    {
+     switch ( (int) user_data )
+      {
+       case 0:
+            plButtonReleased( NULL, (void *) 3 );
+            break;
+       case 1:
+            plButtonReleased( NULL, (void *) 2 );
+            break;
+      }
+    }
+  }
  return FALSE;
 }
 
@@ -567,9 +582,11 @@
   gtk_signal_connect( GTK_OBJECT( CLFiles ),"select_row",GTK_SIGNAL_FUNC( plRowSelect ),(void *)0 );
   gtk_signal_connect( GTK_OBJECT( CLFiles ),"unselect_row",GTK_SIGNAL_FUNC( plUnRowSelect ),(void *)0 );
   gtk_signal_connect( GTK_OBJECT( CLFiles ),"event",GTK_SIGNAL_FUNC( plEvent ),(void *)0 );
+  gtk_signal_connect( GTK_OBJECT( CLFiles ),"key_release_event",GTK_SIGNAL_FUNC( plKeyReleased ),(void *)0 );
   sigSel=gtk_signal_connect( GTK_OBJECT( CLSelected ),"select_row",GTK_SIGNAL_FUNC( plRowSelect ),(void*)1 );
   sigUnsel=gtk_signal_connect( GTK_OBJECT( CLSelected ),"unselect_row",GTK_SIGNAL_FUNC( plUnRowSelect ),(void*)1 );
   sigEvent=gtk_signal_connect( GTK_OBJECT( CLSelected ),"event",GTK_SIGNAL_FUNC( plEvent ),(void *)1 );
+  gtk_signal_connect( GTK_OBJECT( CLSelected ),"key_release_event",GTK_SIGNAL_FUNC( plKeyReleased ),(void *)1 );
 
   gtk_signal_connect( GTK_OBJECT( Add ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)3 );
   gtk_signal_connect( GTK_OBJECT( Add ),"key_release_event",GTK_SIGNAL_FUNC( plKeyReleased ),(void*)3 );