changeset 34344:5a7bb8f06478

Add Return key events to file selector buttons. This helps when operating the GUI with a remote control (and doesn't harm if not).
author ib
date Sun, 11 Dec 2011 15:52:32 +0000
parents 9c695b52687e
children 1f6e77b8cb1d
files gui/ui/gtk/fileselect.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/gtk/fileselect.c	Sun Dec 11 15:41:37 2011 +0000
+++ b/gui/ui/gtk/fileselect.c	Sun Dec 11 15:52:32 2011 +0000
@@ -543,6 +543,12 @@
                                                  GdkEventKey * event,
                                                  gpointer user_data )
 {
+ if ( GTK_WIDGET_TYPE( widget ) == GTK_TYPE_BUTTON )
+ {
+  if (event->keyval == GDK_Return) gtk_button_released( GTK_BUTTON( widget ) );
+ }
+ else
+ {
  switch ( event->keyval )
   {
    case GDK_Escape:
@@ -555,6 +561,7 @@
         gtk_button_released( GTK_BUTTON( fsUp ) );
         break;
   }
+ }
  return FALSE;
 }
 
@@ -711,8 +718,11 @@
  gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsPathCombo_changed ),fsPathCombo );
  gtk_signal_connect( GTK_OBJECT( fsPathCombo ),"activate",GTK_SIGNAL_FUNC( fs_fsPathCombo_activate ),fsPathCombo );
  gtk_signal_connect( GTK_OBJECT( fsUp ),"released",GTK_SIGNAL_FUNC( fs_Up_released ),fsFNameList );
+ gtk_signal_connect( GTK_OBJECT( fsUp ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
  gtk_signal_connect( GTK_OBJECT( fsOk ),"released",GTK_SIGNAL_FUNC( fs_Ok_released ),fsCombo4 );
+ gtk_signal_connect( GTK_OBJECT( fsOk ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
  gtk_signal_connect( GTK_OBJECT( fsCancel ),"released",GTK_SIGNAL_FUNC( fs_Cancel_released ),NULL );
+ gtk_signal_connect( GTK_OBJECT( fsCancel ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
  gtk_signal_connect( GTK_OBJECT( fsFNameList ),"select_row",(GtkSignalFunc)fs_fsFNameList_select_row,NULL );
  gtk_signal_connect( GTK_OBJECT( fsFNameList ),"event", (GtkSignalFunc)fs_fsFNameList_event,NULL );