[MPlayer-dev-eng] [PATCH] Support for special audio keys on "multimedia" keyboards

Jason Tackaberry tack at auc.ca
Thu Apr 3 20:56:15 CEST 2003


I just got a new system, and it came with one of those "internet" or
"multimedia" keyboards that have those extra keys for controlling audio
(stop, rewind, play/pause, forward, mute, etc.)  Properly configured
(such as with Acme, http://www.hadess.net/misc-code.php3), these keys
will emit keysyms such as XF86XK_AudioPrev, XF86XK_AudioPause, etc.  I
really wanted mplayer to work with these controls.

So attached is a patch against current cvs which provides functionality
for the following keys:

        XF86 keysym         MPlayer key name           Default command
        -----------         ----------------           ---------------
        XF86XK_AudioPause   KEY_XF86_PAUSE             pause
        XF86XK_AudioStop    KEY_XF86_STOP              quit
        XF86XK_AudioPrev    KEY_XF86_PREV              step -60
        XF86XK_AudioNext    KEY_XF86_NEXT              step +60
        

Some various comments about the attached implementation:

     1. There was no HAVE_XFREE to #ifdef, so I include X11/XF86keysym.h
        if HAVE_XF86VM is defined.  I think this is probably fine, but
        am not 100% certain.
     2. If XF86XK_AudioPause is not defined (after including
        XF86keysym.h), MPlayer will not pay attention to the extended
        keysyms.  This patch assumes that if XF86XK_AudioPause is
        defined, so are the others.
     3. 'mplayer -input keylist' will list these keys (XF86_PAUSE,
        XF86_STOP, etc.) even if support isn't compiled into MPlayer for
        them (in libvo/x11_common.c).  I don't imagine this is a
        problem, since mplayer lists the JOY_* keys even though I don't
        have a joystick.

Please review this patch and suggest changes/corrections you'd like to
see.  I hope the powers that be accept it for inclusion because I'd
really like to see this in stock MPlayer.

Cheers,
Jason.

-- 
Jason Tackaberry  ::  tack at auc.ca  :: 705-949-2301 x330 
Academic Computing Support Specialist
Information Technology Services
Algoma University College  ::  www.auc.ca

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-multimedia-keys.patch
Type: text/x-patch
Size: 2832 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030403/fa4cc093/attachment.bin>


More information about the MPlayer-dev-eng mailing list