[MPlayer-dev-eng] patch

Rick rick at topaz.ne.mediaone.net
Sun Jan 13 02:56:45 CET 2002


I have made a short little patch to allow easy use of the joy2key program 
with mplayer.  The joy2key program attaches to a joystick and outputs 
keystrokes as if they had actually come from the keyboard.  I have found that 
mlayer's implemenation of receiving input does not with with the output 
joy2key makes for the arrow keys.  This patch simply makes Y=up, G=left, 
H=right, and B=down.  I did not alter the existing tests for the actual arrow 
keys.

--- x11_common.c.orig   Sat Jan 12 20:47:11 2002
+++ x11_common.c        Sat Jan 12 20:46:34 2002
@@ -238,6 +238,10 @@
 void vo_x11_putkey(int key){
  switch ( key )
   {
+   case wsG:        mplayer_put_key(KEY_LEFT); break;
+   case wsH:         mplayer_put_key(KEY_RIGHT); break;
+   case wsY:         mplayer_put_key(KEY_UP); break;
+   case wsB:         mplayer_put_key(KEY_DOWN); break;
    case wsLeft:      mplayer_put_key(KEY_LEFT); break;
    case wsRight:     mplayer_put_key(KEY_RIGHT); break;
    case wsUp:        mplayer_put_key(KEY_UP); break;



More information about the MPlayer-dev-eng mailing list