Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.cpp	(revision 35748)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.cpp	(revision 35749)
@@ -56,4 +56,5 @@
 # include "VBoxUtils.h"
 # include <Carbon/Carbon.h>
+# include <QTimer>
 #endif /* Q_WS_MAC */
 
@@ -303,7 +304,12 @@
 
 #ifdef Q_WS_MAC
-    m_uDarwinKeyModifiers = GetCurrentEventKeyModifiers();
+    m_uDarwinKeyModifiers = 0;
     UICocoaApplication::instance()->registerForNativeEvents(RT_BIT_32(10) | RT_BIT_32(11) | RT_BIT_32(12) /* NSKeyDown  | NSKeyUp | | NSFlagsChanged */, UIHotKeyEditor::darwinEventHandlerProc, this);
     ::DarwinGrabKeyboard(false /* just modifiers */);
+
+    m_pRemoveTimer = new QTimer(this);
+    m_pRemoveTimer->setInterval(200);
+    connect(m_pRemoveTimer, SIGNAL(timeout()),
+            this, SLOT(removePendingKeys()));
 #endif /* Q_WS_MAC */
 }
@@ -515,5 +521,4 @@
             modifierMask = ::DarwinAdjustModifierMask(modifierMask, pvCocoaEvent);
             UInt32 changed = m_uDarwinKeyModifiers ^ modifierMask;
-            m_uDarwinKeyModifiers = modifierMask;
 
             /* Convert to keycode: */
@@ -526,13 +531,17 @@
             if (changed)
             {
+                /* Stop the delete pending keys timer. */
+                m_pRemoveTimer->stop();
+                /* If modifierMask is empty, no key is pressed anymore. Stop
+                 * all key handling and the deletion of keys. This is the
+                 * status the user want. */
+                if (!modifierMask)
+                    m_fStartNewSequence = true;
                 /* Key release: */
-                if (!(changed & modifierMask))
+                else if (!(changed & modifierMask))
                 {
-                    /* Remove pressed symbol: */
-                    m_pressedKeys.remove(iKeyCode);
-
-                    /* If pressed key map is empty => start new sequence: */
-                    if (m_pressedKeys.isEmpty())
-                        m_fStartNewSequence = true;
+                    /* Queue pressed symbol for removing: */
+                    m_removeKeys.insert(iKeyCode);
+                    m_pRemoveTimer->start();
                 }
                 /* Key press: */
@@ -542,5 +551,6 @@
                     if (m_fStartNewSequence)
                         m_shownKeys.clear();
-
+                    /* Make sure any keys pending for removal are removed. */
+                    removePendingKeys();
                     /* Check maximum combo size: */
                     if (m_shownKeys.size() < UIHotKeyCombination::m_iMaxComboSize)
@@ -555,4 +565,6 @@
                 }
             }
+            /* Save the new modifier mask state. */
+            m_uDarwinKeyModifiers = modifierMask;
 
             /* Update text: */
@@ -563,4 +575,26 @@
     return false;
 }
+
+void UIHotKeyEditor::removePendingKeys()
+{
+    /* Stop the timer, we process all pending keys at once. */
+    m_pRemoveTimer->stop();
+    /* Something to do? */
+    if (!m_removeKeys.isEmpty())
+    {
+        /* Remove every key. */
+        foreach(int v, m_removeKeys)
+        {
+            m_pressedKeys.remove(v);
+            m_shownKeys.remove(v);
+        }
+        m_removeKeys.clear();
+        if (m_pressedKeys.isEmpty())
+            m_fStartNewSequence = true;
+    }
+    /* Make sure the user see what happens. */
+    updateText();
+}
+
 #endif /* Q_WS_MAC */
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.h	(revision 35748)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.h	(revision 35749)
@@ -90,9 +90,13 @@
     bool m_fStartNewSequence;
 
-#ifdef Q_WS_MAC
+#ifdef RT_OS_DARWIN
+    QSet<int> m_removeKeys;
+    QTimer* m_pRemoveTimer;
     /* The current modifier key mask. Used to figure out which modifier
      * key was pressed when we get a kEventRawKeyModifiersChanged event. */
     uint32_t m_uDarwinKeyModifiers;
-#endif /* Q_WS_MAC */
+private slots:
+    void removePendingKeys();
+#endif /* RT_OS_DARWIN */
 };
 
