changeset 6183:a4bbda72ce86

fix two small bug and add multimedia keyboard support ( i tested with Acer AirKey V only )
author pontscho
date Sat, 25 May 2002 09:46:37 +0000
parents 17a410342277
children 47297acadbfb
files Gui/mplayer/mw.h Gui/wm/ws.c Gui/wm/ws.h Gui/wm/wskeys.h input/input.c mplayer.c
diffstat 6 files changed, 84 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/mw.h	Sat May 25 08:48:05 2002 +0000
+++ b/Gui/mplayer/mw.h	Sat May 25 09:46:37 2002 +0000
@@ -540,53 +540,70 @@
 
 int keyPressed = 0;
 
-void mplMainKeyHandle( int State,int Type,int Key )
+void mplMainKeyHandle( int KeyCode,int Type,int Key )
 {
  int msg = evNone;
 
  if ( Type != wsKeyPressed ) return;
- switch ( Key )
+ 
+ if ( !Key )
   {
-   case wsEnter:     msg=evPlay; break;
+   switch ( KeyCode )
+    {
+     case wsXFMMPrev:     msg=evPrev;              break;
+     case wsXFMMStop:	  msg=evStop;              break;
+     case wsXFMMPlay:	  msg=evPlaySwitchToPause; break;
+     case wsXFMMNext:	  msg=evNext;	           break;
+     case wsXFMMVolUp:	  msg=evIncVolume;         break;
+     case wsXFMMVolDown:  msg=evDecVolume;         break;
+     case wsXFMMMute: 	  msg=evMute;	           break;
+    }
+  }
+  else
+   {
+    switch ( Key )
+     {
+      case wsEnter:     msg=evPlay; break;
 #ifndef HAVE_NEW_INPUT
-   case '.':
-   case '>':         msg=evNext; break;
-   case ',':
-   case '<':         msg=evPrev; break;
-
-   case wsEscape:    msg=evExit; break;
+      case '.':
+      case '>':         msg=evNext; break;
+      case ',':
+      case '<':         msg=evPrev; break;
 
-   case wsSpace:     msg=evPause; break;
-   case wsa:
-   case wsA:         msg=evAbout; break;
-   case wsb:
-   case wsB:         msg=evSkinBrowser; break;
-   case wse:
-   case wsE:         msg=evEqualeaser; break;
-   case wsf:
-   case wsF:         msg=evFullScreen; break;
-   case wsl:
-   case wsL:         msg=evLoad; break;
-   case wsu:
-   case wsU:         msg=evLoadSubtitle; break;
-   case wsm:
-   case wsM:         msg=evMute; break;
-   case wss:
-   case wsS:         msg=evStop; break;
-   case wsp:
-   case wsP:         msg=evPlayList; break;
+      case wsEscape:    msg=evExit; break;
+
+      case wsSpace:     msg=evPause; break;
+      case wsa:
+      case wsA:         msg=evAbout; break;
+      case wsb:
+      case wsB:         msg=evSkinBrowser; break;
+      case wse:
+      case wsE:         msg=evEqualeaser; break;
+      case wsf:
+      case wsF:         msg=evFullScreen; break;
+      case wsl:
+      case wsL:         msg=evLoad; break;
+      case wsu:
+      case wsU:         msg=evLoadSubtitle; break;
+      case wsm:
+      case wsM:         msg=evMute; break;
+      case wss:
+      case wsS:         msg=evStop; break;
+      case wsp:
+      case wsP:         msg=evPlayList; break;
 #endif
 
-   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;
+      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:          vo_x11_putkey( Key ); return;
-  }
+      default:          vo_x11_putkey( Key ); return;
+     }
+   }
  if ( msg != evNone ) mplEventHandling( msg,0 );
 }
--- a/Gui/wm/ws.c	Sat May 25 08:48:05 2002 +0000
+++ b/Gui/wm/ws.c	Sat May 25 09:46:37 2002 +0000
@@ -618,14 +618,17 @@
         if ( Event->xkey.state & ShiftMask ) wsWindowList[l]->Shift=1;
         if ( Event->xkey.state & LockMask ) wsWindowList[l]->CapsLock=1;
 #if 0
-        keySym=XKeycodeToKeysym( wsDisplay,Event->xkey.keycode,0 );
-        if ( keySym != NoSymbol )
-         {
-          keySym=( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) );
-          wsKeyTable[ keySym ]=i;
-          if ( wsWindowList[l]->KeyHandler )
-            wsWindowList[l]->KeyHandler( Event->xkey.state,i,keySym );
-         }
+        {
+	 KeySym        keySym;
+         keySym=XKeycodeToKeysym( wsDisplay,Event->xkey.keycode,0 );
+         if ( keySym != NoSymbol )
+          {
+           keySym=( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) );
+           wsKeyTable[ keySym ]=i;
+           if ( wsWindowList[l]->KeyHandler )
+             wsWindowList[l]->KeyHandler( Event->xkey.state,i,keySym );
+          }
+	}
 #else
 	{
         	int    		key;
@@ -636,7 +639,7 @@
 	 XLookupString( &Event->xkey,buf,sizeof(buf),&keySym,&stat );
 	 key=( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) );
 	 wsKeyTable[ key ]=i;
-	 if ( wsWindowList[l]->KeyHandler ) wsWindowList[l]->KeyHandler( Event->xkey.state,i,key );
+	 if ( wsWindowList[l]->KeyHandler ) wsWindowList[l]->KeyHandler( Event->xkey.keycode,i,key );
 	}
 #endif
         break;
--- a/Gui/wm/ws.h	Sat May 25 08:48:05 2002 +0000
+++ b/Gui/wm/ws.h	Sat May 25 09:46:37 2002 +0000
@@ -98,7 +98,7 @@
 typedef   void (*wsTReDraw)( wsParamDisplay );
 typedef   void (*wsTReSize)( unsigned int X,unsigned int Y,unsigned int width,unsigned int height );
 typedef   void (*wsTIdle)( void );
-typedef   void (*wsTKeyHandler)( int State,int Type,int Key );
+typedef   void (*wsTKeyHandler)( int KeyCode,int Type,int Key );
 typedef   void (*wsTMouseHandler)( int Button,int X,int Y,int RX,int RY  );
 typedef   void (*wsRemoteHandler)( char * str );
 
--- a/Gui/wm/wskeys.h	Sat May 25 08:48:05 2002 +0000
+++ b/Gui/wm/wskeys.h	Sat May 25 09:46:37 2002 +0000
@@ -141,6 +141,14 @@
 #define wsXF86Next        0x17 + 256
 #define wsXF86Media       0x32 + 256
 
+#define wsXFMMPrev        0x98
+#define wsXFMMStop        0xb1
+#define wsXFMMPlay	  0x95
+#define wsXFMMNext        0x93
+#define wsXFMMVolUp       0xad
+#define wsXFMMVolDown     0xa6
+#define wsXFMMMute        0x99
+
 #define wsKeyNumber 128
 
 typedef struct
--- a/input/input.c	Sat May 25 08:48:05 2002 +0000
+++ b/input/input.c	Sat May 25 09:46:37 2002 +0000
@@ -625,13 +625,13 @@
     cmd = mp_input_find_bind_for_key(def_cmd_binds,n,keys);
 
   if(cmd == NULL) {
-    mp_msg(MSGT_INPUT,MSGL_ERR,"No bind found for key %s",mp_input_get_key_name(keys[0]));
+    mp_msg(MSGT_INPUT,MSGL_WARN,"No bind found for key %s",mp_input_get_key_name(keys[0]));
     if(n > 1) {
       int s;
       for(s=1; s < n; s++)
-	mp_msg(MSGT_INPUT,MSGL_ERR,"-%s",mp_input_get_key_name(keys[s]));
+	mp_msg(MSGT_INPUT,MSGL_WARN,"-%s",mp_input_get_key_name(keys[s]));
     }
-    mp_msg(MSGT_INPUT,MSGL_ERR,"                         \n");
+    mp_msg(MSGT_INPUT,MSGL_WARN,"                         \n");
     return NULL;
   }
   ret =  mp_input_parse_cmd(cmd);
--- a/mplayer.c	Sat May 25 08:48:05 2002 +0000
+++ b/mplayer.c	Sat May 25 09:46:37 2002 +0000
@@ -1934,7 +1934,11 @@
         video_out->control(VOCTRL_RESUME, NULL);	// resume video
       (void)GetRelativeTime();	// keep TF around FT in next cycle
 #ifdef HAVE_NEW_GUI
-      if (use_gui) guiGetEvent( guiCEvent,(char *)guiSetPlay );
+      if (use_gui) 
+       {
+        if ( guiIntfStruct.Playing == guiSetStop ) goto goto_next_file;
+        guiGetEvent( guiCEvent,(char *)guiSetPlay );
+       }
 #endif
   }