[totem] main: Handle "Powerpoint" buttons on remotes



commit 2706ca99dee84e394d3e82310bfcb5a856c0c799
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Aug 24 00:08:00 2013 +0200

    main: Handle "Powerpoint" buttons on remotes
    
    Some remotes, including the Logitech Presenter R800:
    http://www.logitech.com/en-us/product/professional-presenter-r800-business
    have a number of buttons bound to make it easier to use Powerpoint
    presentations.
    
    We bind some of the buttons used on those presenters to functions
    in Totem to allow starting/stopping playback and seeking.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704608

 src/totem-object.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index 9a737f6..7fc75fa 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3201,6 +3201,7 @@ totem_object_handle_key_press (TotemObject *totem, GdkEventKey *event)
 {
        GdkModifierType mask;
        gboolean retval;
+       gboolean switch_rtl = FALSE;
 
        retval = TRUE;
 
@@ -3225,6 +3226,11 @@ totem_object_handle_key_press (TotemObject *totem, GdkEventKey *event)
                bacon_video_widget_dvd_event (totem->bvw,
                                BVW_DVD_CHAPTER_MENU);
                break;
+       case GDK_KEY_F5:
+               /* Start presentation button */
+               totem_object_set_fullscreen (totem, TRUE);
+               totem_object_play_pause (totem);
+               break;
        case GDK_KEY_F11:
        case GDK_KEY_f:
        case GDK_KEY_F:
@@ -3319,18 +3325,22 @@ totem_object_handle_key_press (TotemObject *totem, GdkEventKey *event)
                break;
        case GDK_KEY_Left:
        case GDK_KEY_Right:
+               switch_rtl = TRUE;
+               /* fall through */
+       case GDK_KEY_Page_Up:
+       case GDK_KEY_Page_Down:
                if (bacon_video_widget_has_menus (totem->bvw) == FALSE) {
                        gboolean is_forward;
 
-                       is_forward = (event->keyval == GDK_KEY_Right);
+                       is_forward = (event->keyval == GDK_KEY_Right || event->keyval == GDK_KEY_Page_Up);
                        /* Switch direction in RTL environment */
-                       if (gtk_widget_get_direction (totem->win) == GTK_TEXT_DIR_RTL)
+                       if (switch_rtl && gtk_widget_get_direction (totem->win) == GTK_TEXT_DIR_RTL)
                                is_forward = !is_forward;
 
                        if (totem_object_is_seekable (totem))
                                totem_object_handle_seek (totem, event, is_forward);
                } else {
-                       if (event->keyval == GDK_KEY_Left)
+                       if (event->keyval == GDK_KEY_Left || event->keyval == GDK_KEY_Page_Down)
                                bacon_video_widget_dvd_event (totem->bvw, BVW_DVD_ROOT_MENU_LEFT);
                        else
                                bacon_video_widget_dvd_event (totem->bvw, BVW_DVD_ROOT_MENU_RIGHT);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]