changeset 33145:1e637ada9003

Avoid MPlayer ignoring a key press completely, instead sending MP_KEY_RELEASE_ALL all the time.
author reimar
date Thu, 07 Apr 2011 21:49:06 +0000
parents a2a32138597b
children 3a1f250bb285
files mp_fifo.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mp_fifo.c	Thu Apr 07 21:48:16 2011 +0000
+++ b/mp_fifo.c	Thu Apr 07 21:49:06 2011 +0000
@@ -39,6 +39,9 @@
     return;
   // in the worst case, just reset key state
   if (fifo_free == 1) {
+    // ensure we do not only create MP_KEY_RELEASE_ALL events
+    if (previous_down_key & MP_KEY_RELEASE_ALL)
+      return;
     // HACK: this ensures that a fifo size of 2 does
     // not queue any key presses while still allowing
     // the mouse wheel to work (which sends down and up
@@ -52,7 +55,7 @@
   if (code & MP_KEY_DOWN)
     previous_down_key = code & ~MP_KEY_DOWN;
   else
-    previous_down_key = 0;
+    previous_down_key = code & MP_KEY_RELEASE_ALL;
 }
 
 int mplayer_get_key(int fd){