diff --git a/input/input.c b/input/input.c index 916bae441d..9fb48567da 100644 --- a/input/input.c +++ b/input/input.c @@ -182,6 +182,12 @@ static mp_key_name_t key_names[] = { { JOY_BTN7, "JOY_BTN7" }, { JOY_BTN8, "JOY_BTN8" }, { JOY_BTN9, "JOY_BTN9" }, + + { KEY_XF86_PAUSE, "XF86_PAUSE" }, + { KEY_XF86_STOP, "XF86_STOP" }, + { KEY_XF86_PREV, "XF86_PREV" }, + { KEY_XF86_NEXT, "XF86_NEXT" }, + { 0, NULL } }; @@ -284,6 +290,12 @@ static mp_cmd_bind_t def_cmd_binds[] = { { { 's', 0 }, "screenshot" }, { { 'w', 0 }, "panscan -0.1" }, { { 'e', 0 }, "panscan +0.1" }, + + { { KEY_XF86_PAUSE, 0 }, "pause" }, + { { KEY_XF86_STOP, 0 }, "quit" }, + { { KEY_XF86_PREV, 0 }, "seek -60" }, + { { KEY_XF86_NEXT, 0 }, "seek +60" }, + { { 0 }, NULL } }; diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 9f233fe91c..820bad441a 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -33,6 +33,7 @@ #ifdef HAVE_XF86VM #include +#include #endif #include "../input/input.h" @@ -403,6 +404,19 @@ void vo_uninit( void ) extern void mplayer_put_key(int code); +#ifdef XF86XK_AudioPause +void vo_x11_putkey_ext(int keysym){ + switch ( keysym ) + { + case XF86XK_AudioPause: mplayer_put_key(KEY_XF86_PAUSE); break; + case XF86XK_AudioStop: mplayer_put_key(KEY_XF86_STOP); break; + case XF86XK_AudioPrev: mplayer_put_key(KEY_XF86_PREV); break; + case XF86XK_AudioNext: mplayer_put_key(KEY_XF86_NEXT); break; + default: + } +} +#endif + void vo_x11_putkey(int key){ switch ( key ) { @@ -636,6 +650,9 @@ int vo_x11_check_events(Display *mydisplay){ { int key; XLookupString( &Event.xkey,buf,sizeof(buf),&keySym,&stat ); + #ifdef XF86XK_AudioPause + vo_x11_putkey_ext( keySym ); + #endif key=( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) ); #ifdef HAVE_NEW_GUI if ( ( use_gui )&&( key == wsEnter ) ) break; diff --git a/osdep/keycodes.h b/osdep/keycodes.h index e0b963535c..437ba0e524 100644 --- a/osdep/keycodes.h +++ b/osdep/keycodes.h @@ -34,3 +34,9 @@ #define KEY_DOWN (KEY_CRSR+2) #define KEY_UP (KEY_CRSR+3) +/* XF86 Multimedia keyboard keys */ +#define KEY_XF86_BASE (0x100+384) +#define KEY_XF86_PAUSE (KEY_XF86_BASE+1) +#define KEY_XF86_STOP (KEY_XF86_BASE+2) +#define KEY_XF86_PREV (KEY_XF86_BASE+3) +#define KEY_XF86_NEXT (KEY_XF86_BASE+4)