[totem/wip/hadess/keyboard-shortcuts: 3/3] main: Add 'M' shortcut to toggle mute




commit 250cfb1fc6a1f28fd8d3d2c644e62058c02fd6db
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Feb 15 15:07:02 2022 +0100

    main: Add 'M' shortcut to toggle mute
    
    'M' was already used for the (increasingly rare) "go to root menu of a
    DVD", so mute is only toggled when not playing a DVD.
    
    This is the same shortcut as YouTube uses:
    https://support.google.com/youtube/answer/7631406?hl=en
    
    Closes: #457

 README             | 2 ++
 src/totem-object.c | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/README b/README
index 017859b1f..4ab0a8eaa 100644
--- a/README
+++ b/README
@@ -29,6 +29,8 @@ Ctrl+H:
        Shortcut help
 
 Undocumented shortcuts:
+M (when playing a DVD):
+       Menu
 Ctrl+Q:
        Quit
 Ctrl+W:
diff --git a/src/totem-object.c b/src/totem-object.c
index 03e3b0b66..61afe50cb 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3469,7 +3469,10 @@ totem_object_handle_key_press (TotemObject *totem, GdkEventKey *event)
                break;
        case GDK_KEY_M:
        case GDK_KEY_m:
-               bacon_video_widget_dvd_event (totem->bvw, BVW_DVD_ROOT_MENU);
+               if (totem_playing_dvd (totem->mrl))
+                       bacon_video_widget_dvd_event (totem->bvw, BVW_DVD_ROOT_MENU);
+               else
+                       totem_object_volume_toggle_mute (totem);
                break;
        case GDK_KEY_AudioNext:
        case GDK_KEY_Forward:


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