[vlc-commits] Win32: workaround awesome Windows key design

Jean-Baptiste Kempf git at videolan.org
Wed Jan 29 20:13:31 CET 2014


vlc/vlc-2.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Jan 29 19:59:20 2014 +0100| [269d4f3d1ee1e03a7dd05ac943ed42c7e249a562] | committer: Jean-Baptiste Kempf

Win32: workaround awesome Windows key design

Multimedia Keys, on Windows, generate both WM_APPCOMMAND and WM_KEYDOWN,
even if you accept the first, because that makes so much sense.
But some remotes only generate the APPCOMMAND ones, of course...

Therefore, Qt will get the messages twice and do play/pause.
This is not the correct fix, I'm afraid, but this will do until someone
redoes the configuration of the options and fixes the APPCOMMAND
handling with a correct MCE remote. This will do it for now...

Close #9521

(cherry picked from commit e8668774da18804c7ab22b9cf62d119423495afc)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=269d4f3d1ee1e03a7dd05ac943ed42c7e249a562
---

 src/libvlc-module.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 250e791..8da7488 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -2256,7 +2256,6 @@ vlc_module_begin ()
      */
 #   define KEY_TOGGLE_FULLSCREEN  "f"
 #   define KEY_LEAVE_FULLSCREEN   "Esc"
-#   define KEY_PLAY_PAUSE         "Space\tMedia Play Pause"
 #   define KEY_PAUSE              "Browser Stop"
 #   define KEY_PLAY               "Browser Refresh"
 #   define KEY_FASTER             "+"
@@ -2264,9 +2263,17 @@ vlc_module_begin ()
 #   define KEY_RATE_NORMAL        "="
 #   define KEY_RATE_FASTER_FINE   "]"
 #   define KEY_RATE_SLOWER_FINE   "["
+#ifdef _WIN32
+#   define KEY_PLAY_PAUSE         "Space"
+#   define KEY_NEXT               "n"
+#   define KEY_PREV               "p"
+#   define KEY_STOP               "s"
+#else
+#   define KEY_PLAY_PAUSE         "Space\tMedia Play Pause"
 #   define KEY_NEXT               "n\tMedia Next Track"
 #   define KEY_PREV               "p\tMedia Prev Track"
 #   define KEY_STOP               "s\tMedia Stop"
+#endif
 #   define KEY_POSITION           "t"
 #   define KEY_JUMP_MEXTRASHORT   "Shift+Left"
 #   define KEY_JUMP_PEXTRASHORT   "Shift+Right"
@@ -2276,7 +2283,6 @@ vlc_module_begin ()
 #   define KEY_JUMP_PMEDIUM       "Ctrl+Right"
 #   define KEY_JUMP_MLONG         "Ctrl+Alt+Left"
 #   define KEY_JUMP_PLONG         "Ctrl+Alt+Right"
-#   define KEY_FRAME_NEXT         "e\tBrowser Next"
 #   define KEY_NAV_ACTIVATE       "Enter"
 #   define KEY_NAV_UP             "Up"
 #   define KEY_NAV_DOWN           "Down"
@@ -2287,12 +2293,15 @@ vlc_module_begin ()
 #ifdef _WIN32 /* On Windows, people expect volume keys to control the master */
 #   define KEY_VOL_UP             "Ctrl+Up"
 #   define KEY_VOL_DOWN           "Ctrl+Down"
+#   define KEY_VOL_MUTE           "m"
+#   define KEY_FRAME_NEXT         "e"
 #else
 #   define KEY_VOL_UP             "Ctrl+Up\tVolume Up"
 #   define KEY_VOL_DOWN           "Ctrl+Down\tVolume Down"
+#   define KEY_VOL_MUTE           "m\tVolume Mute"
+#   define KEY_FRAME_NEXT         "e\tBrowser Next"
 #endif
 
-#   define KEY_VOL_MUTE           "m\tVolume Mute"
 #   define KEY_SUBDELAY_UP        "h"
 #   define KEY_SUBDELAY_DOWN      "g"
 #   define KEY_SUBPOS_DOWN        NULL



More information about the vlc-commits mailing list