Support for "internet" or "multimedia" keyboards in X11.

Patch from Jason Tackaberry <tack at auc dot ca>.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9823 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
albeu 2003-04-04 15:04:26 +00:00
parent 37805cf27c
commit ec92ba43f1
3 changed files with 35 additions and 0 deletions

View File

@ -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 }
};

View File

@ -33,6 +33,7 @@
#ifdef HAVE_XF86VM
#include <X11/extensions/xf86vmode.h>
#include <X11/XF86keysym.h>
#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;

View File

@ -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)