[MPlayer-dev-eng] [PATCH] directx keys

Joey Parrish joey at nicewarrior.org
Tue Nov 18 20:33:18 CET 2003


Hello,

Here's a patch to fix a bug found when 'q' is not bound to 'quit'.

Also, mplayer keycodes.h says CTRL and BS are the same,
so i replace CONTROL with BACK.  Windows keys are not
the same for these two, but mplayer input layer can't
think of them as different, so I replace instead of add.

Without this patch, pressing backspace on console makes mplayer say
'no key for CTRL' and pressing backspace on directx window sends
keycode 0x8 to input layer.

If this is wrong to change in vo_directx, then I say KEY_BACKSPACE
should be changed to 0x8 instead of (CTRL+0) in keycodes.h.  I
haven't tested on linux, if this is wrong too, then my final
suggestion is changing KEY_BS to 0x8 if defined MINGW or something.

But the first chunk is obviously correct.
Okay to commit, and which part?

--Joey

-- 
"Living in the complex world of the future is somewhat
like having bees live in your head.  But, there they are."
-------------- next part --------------
fixes a bug (click close, doesn't quit)
  found when key 'q' is not bound to command 'quit'

also, mplayer keycodes.h says CTRL and BS are the same,
so i replace CONTROL with BACK.  windows keys are not
the same for these two, but mplayer can't think of them
as different, so i replace instead of add.


diff -ur main.sofar/libvo/vo_directx.c main.dev/libvo/vo_directx.c
--- main.sofar/libvo/vo_directx.c	2003-11-18 11:59:24.471659200 -0600
+++ main.dev/libvo/vo_directx.c	2003-11-18 12:05:53.270724800 -0600
@@ -744,7 +744,7 @@
 		}
         case WM_CLOSE:
 		{
-			mplayer_put_key('q');
+			mp_input_queue_cmd(mp_input_parse_cmd("quit"));
 			return 0;
 		}
         case WM_WINDOWPOSCHANGED:
@@ -783,8 +783,8 @@
 					{mplayer_put_key(KEY_DOWN);break;} 
 	            case VK_TAB:
 					{mplayer_put_key(KEY_TAB);break;}
-		        case VK_CONTROL:
-					{mplayer_put_key(KEY_CTRL);break;}
+		        case VK_BACK:
+					{mplayer_put_key(KEY_BS);break;}
 		        case VK_DELETE:
 					{mplayer_put_key(KEY_DELETE);break;}
 		        case VK_INSERT:


More information about the MPlayer-dev-eng mailing list