[MPlayer-dev-eng] [PATCH] Support for multimedia keys on internet keyboards

Gwendal Stevanazzi gwendal.stevanazzi at enst-bretagne.fr
Tue Jan 29 16:27:44 CET 2002


I've only tried this patch with my own keyboard but it should work with
any well configured multimedia keyboard.
-------------- next part --------------
Index: Gui/mplayer/mw.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.h,v
retrieving revision 1.40
diff -u -b -B -r1.40 mw.h
--- Gui/mplayer/mw.h    9 Jan 2002 12:41:58 -0000       1.40
+++ Gui/mplayer/mw.h    29 Jan 2002 14:33:08 -0000
@@ -612,6 +612,14 @@
    case wsS:         msg=evStop; break;
    case wsp:
    case wsP:         msg=evPlayList; break;
+   case wsXF86LowerVolume:  msg=evDecVolume; break;
+   case wsXF86RaiseVolume:  msg=evIncVolume; break;
+   case wsXF86Mute:         msg=evMute; break;
+   case wsXF86Play:         msg=evPlaySwitchToPause; break;
+   case wsXF86Stop:         msg=evStop; break;
+   case wsXF86Prev:         msg=evPrev; break;
+   case wsXF86Next:         msg=evNext; break;
+   case wsXF86Media:        msg=evLoad; break;
    default:          if ( Type == wsKeyPressed ) vo_x11_putkey( Key );
return;
   }
  if ( ( msg != evNone )&&( Type == wsKeyPressed ) )
Index: Gui/wm/wskeys.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/wm/wskeys.h,v
retrieving revision 1.1
diff -u -b -B -r1.1 wskeys.h
--- Gui/wm/wskeys.h     25 Aug 2001 21:04:29 -0000      1.1
+++ Gui/wm/wskeys.h     29 Jan 2002 14:33:08 -0000
@@ -126,6 +126,17 @@
 #define wsGrayUp        0xb8 + 256
 #define wsGrayPageUp    0xb9 + 256
 
+
+//Keys for multimedia keyboard
+#define wsXF86LowerVolume 0x11 + 256
+#define wsXF86RaiseVolume 0x13 + 256
+#define wsXF86Mute        0x12 + 256
+#define wsXF86Play        0x14 + 256
+#define wsXF86Stop        0x15 + 256
+#define wsXF86Prev        0x16 + 256
+#define wsXF86Next        0x17 + 256
+#define wsXF86Media       0x32 + 256
+
 #define wsKeyNumber 116
 
 typedef struct


More information about the MPlayer-dev-eng mailing list