Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp	(revision 38927)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp	(revision 38928)
@@ -934,7 +934,4 @@
         return false;
 
-    if (!m_fIsKeyboardCaptured)
-        return false;
-
     /* Sometimes it happens that Win inserts additional events on some key
      * press/release. For example, it prepends ALT_GR in German layout with
@@ -954,4 +951,12 @@
             return true;
     }
+
+    /** @todo this needs to be after the preceding check so that
+     *        we ignore those spurious key events even when the
+     *        keyboard is not captured.  However, that is probably a
+     *        hint that that filtering should be done somewhere else,
+     *        and not in the keyboard capture handler. */
+    if (!m_fIsKeyboardCaptured)
+        return false;
 
     /* It's possible that a key has been pressed while the keyboard was not
