[MPlayer-dev-eng] [PATCH] Remove shift_key from vo_sdl.c

Michael Mauch michael.mauch at gmx.de
Tue Oct 23 00:42:15 CEST 2007


Hi,

does anybody know about these shift_key tests in the key handling of
vo_sdl.c, e.g.

    case SDLK_7: mplayer_put_key(shift_key?'/':'7');
    case SDLK_PLUS: mplayer_put_key(shift_key?'*':'+');
    case SDLK_KP_PLUS: mplayer_put_key('+');break;
...
    case SDLK_LESS: mplayer_put_key(shift_key?'>':'<'); break;
    case SDLK_GREATER: mplayer_put_key('>'); break;


Probably that was a workaround for a bug in an old version of SDL?

It doesn't look correct for a keyboard that needs shift to get a "+",
because that ends up as "mplayer_put_key('*')".

Attached is a patch that removes almost all (=3) of these shift_key
tests. I only left in one of them, inside that #ifdef BUGGY_SDL.

Regards...
                Michael
-------------- next part --------------
Index: vo_sdl.c
===================================================================
--- vo_sdl.c	(Revision 24841)
+++ vo_sdl.c	(Arbeitskopie)
@@ -1274,8 +1274,8 @@
                                 /*case SDLK_o: mplayer_put_key('o');break;
                                 case SDLK_SPACE: mplayer_put_key(' ');break;
                                 case SDLK_p: mplayer_put_key('p');break;*/
-				case SDLK_7: mplayer_put_key(shift_key?'/':'7');
-                                case SDLK_PLUS: mplayer_put_key(shift_key?'*':'+');
+				 case SDLK_7: mplayer_put_key('7');break;
+                                case SDLK_PLUS:
                                 case SDLK_KP_PLUS: mplayer_put_key('+');break;
                                 case SDLK_MINUS:
                                 case SDLK_KP_MINUS: mplayer_put_key('-');break;
@@ -1297,7 +1297,7 @@
                                 case SDLK_DOWN: mplayer_put_key(KEY_DOWN);break;
                                 case SDLK_LEFT: mplayer_put_key(KEY_LEFT);break;
                                 case SDLK_RIGHT: mplayer_put_key(KEY_RIGHT);break;
-                                case SDLK_LESS: mplayer_put_key(shift_key?'>':'<'); break;
+                                case SDLK_LESS: mplayer_put_key('<'); break;
                                 case SDLK_GREATER: mplayer_put_key('>'); break;
                                 case SDLK_ASTERISK:
 				case SDLK_KP_MULTIPLY: mplayer_put_key('*'); break;


More information about the MPlayer-dev-eng mailing list