changeset 9822:1e761763566c

Support for "internet" or "multimedia" keyboards in X11. Patch from Jason Tackaberry <tack at auc dot ca>.
author albeu
date Fri, 04 Apr 2003 15:04:26 +0000
parents e44420ecb523
children da375915f47c
files input/input.c libvo/x11_common.c osdep/keycodes.h
diffstat 3 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/input/input.c	Fri Apr 04 14:42:33 2003 +0000
+++ b/input/input.c	Fri Apr 04 15:04:26 2003 +0000
@@ -182,6 +182,12 @@
   { 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 @@
   { { '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 }
 };
 
--- a/libvo/x11_common.c	Fri Apr 04 14:42:33 2003 +0000
+++ b/libvo/x11_common.c	Fri Apr 04 15:04:26 2003 +0000
@@ -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 @@
 
 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 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;
--- a/osdep/keycodes.h	Fri Apr 04 14:42:33 2003 +0000
+++ b/osdep/keycodes.h	Fri Apr 04 15:04:26 2003 +0000
@@ -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)