]> git.sesse.net Git - vlc/commitdiff
Win32: added config option to disable volume keys.
authorAlex Helfet <alex.helfet@googlemail.com>
Wed, 8 Dec 2010 01:09:33 +0000 (01:09 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 8 Dec 2010 16:28:24 +0000 (17:28 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/main_interface_win32.cpp
modules/gui/qt4/qt4.cpp

index 62aed64cc4c1b21d4b883f392e62c51a3ba650d1..e751aa54c2f659d66f4190b19493e4ce67dec5a4 100644 (file)
@@ -182,7 +182,18 @@ bool MainInterface::winEvent ( MSG * msg, long * result )
             break;
         case WM_APPCOMMAND:
             cmd = GET_APPCOMMAND_LPARAM(msg->lParam);
+
+            bool disable_volume_keys = var_InheritBool( p_intf, "qt-disable-volume-keys" );
+            if( disable_volume_keys &&
+                    (   cmd == APPCOMMAND_VOLUME_DOWN   ||
+                        cmd == APPCOMMAND_VOLUME_UP     ||
+                        cmd == APPCOMMAND_VOLUME_MUTE ) )
+            {
+                break;
+            }
+
             *result = TRUE;
+
             switch(cmd)
             {
                 case APPCOMMAND_MEDIA_PLAY_PAUSE:
index 6f1ada6588b28da5cf9a41115707c5766e49b891..8ba9df2c4568ef542e8643a0dd718f78ca60f9a2 100644 (file)
@@ -171,6 +171,13 @@ static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
                             "Can be disabled to prevent burning screen." )
 #define QT_BGCONE_EXPANDS_TEXT N_( "Expanding background cone or art." )
 #define QT_BGCONE_EXPANDS_LONGTEXT N_( "Background art fits window's size" )
+
+#define QT_DISABLE_VOLUME_KEYS_TEXT N_( "Ignore keyboard volume buttons." )
+#define QT_DISABLE_VOLUME_KEYS_LONGTEXT N_(                                             \
+    "With this option checked, the volume up, volume down and mute buttons on your "    \
+    "keyboard will always change your system volume. With this option unchecked, the "  \
+    "volume buttons will change VLC's volume when VLC is selected and change the "      \
+    "system volume when VLC is not selected." )
 /**********************************************************************/
 vlc_module_begin ()
     set_shortname( "Qt" )
@@ -248,6 +255,14 @@ vlc_module_begin ()
     add_bool( "qt-bgcone-expands", false, QT_BGCONE_EXPANDS_TEXT,
               QT_BGCONE_EXPANDS_LONGTEXT, true )
 
+#ifdef WIN32
+    add_bool( "qt-disable-volume-keys"             /* name */,
+              false                                /* default value */,
+              QT_DISABLE_VOLUME_KEYS_TEXT          /* text */,
+              QT_DISABLE_VOLUME_KEYS_LONGTEXT      /* longtext */,
+              false                                /* advanced mode only */)
+#endif
+
     add_obsolete_bool( "qt-blingbling" ) /* Suppressed since 1.0.0 */
     add_obsolete_integer( "qt-display-mode" ) /* Suppressed since 1.1.0 */