Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.cpp	(revision 50682)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.cpp	(revision 50683)
@@ -96,7 +96,16 @@
             }
         }
-#ifdef Q_WS_MAC
         else if (vboxGlobal().isVMConsoleProcess())
         {
+            /* Take care about HID LEDs sync */
+            if (strKey == GUI_HidLedsSync)
+            {
+                /* If extra data GUI/HidLedsSync is not present in VM config or set
+                 * to 1 then sync is enabled. Otherwise, it is disabled. */
+                bool f = (strValue.isEmpty() || strValue == "1") ? true : false;
+                emit sigHidLedsSyncStateChanged(f);
+            }
+
+#ifdef Q_WS_MAC
             /* Check for the currently running machine */
             if (strId == vboxGlobal().managedVMUuid())
@@ -109,6 +118,6 @@
                 }
             }
+#endif /* Q_WS_MAC */
         }
-#endif /* Q_WS_MAC */
     }
 
@@ -118,4 +127,5 @@
     void sigSelectorShortcutsChanged();
     void sigMachineShortcutsChanged();
+    void sigHidLedsSyncStateChanged(bool fEnabled);
 #ifdef RT_OS_DARWIN
     void sigPresentationModeChange(bool fEnabled);
@@ -191,4 +201,8 @@
             Qt::QueuedConnection);
 
+    connect(m_pHandler, SIGNAL(sigHidLedsSyncStateChanged(bool)),
+            this, SIGNAL(sigHidLedsSyncStateChanged(bool)),
+            Qt::QueuedConnection);
+
 #ifdef Q_WS_MAC
     connect(m_pHandler, SIGNAL(sigPresentationModeChange(bool)),
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.h	(revision 50682)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.h	(revision 50683)
@@ -39,4 +39,5 @@
     void sigSelectorShortcutsChanged();
     void sigMachineShortcutsChanged();
+    void sigHidLedsSyncStateChanged(bool fEnabled);
 #ifdef RT_OS_DARWIN
     void sigPresentationModeChange(bool fEnabled);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp	(revision 50682)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp	(revision 50683)
@@ -1214,9 +1214,11 @@
     {
         /* Check if the guest has the same view on the modifier keys
-         * (NumLock, CapsLock, ScrollLock) as the X server.
-         * If not, send KeyPress events to synchronize the state: */
-#if !defined(Q_WS_MAC) && !defined(Q_WS_WIN)
-        if (fFlags & KeyPressed)
-            fixModifierState(pCodes, puCodesCount);
+         * (NumLock, CapsLock, ScrollLock) as the X server. */
+#if !defined(Q_WS_MAC)
+        /* If there is no HID LEDs sync enabled or supported
+         * we should re-sync keyboard LEDs and state following this way. */
+        if (!machineLogic()->isHidLedsSyncEnabled())
+            if (fFlags & KeyPressed)
+                fixModifierState(pCodes, puCodesCount);
 #endif
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 50682)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 50683)
@@ -56,4 +56,5 @@
 #include "UIModalWindowManager.h"
 #include "UIMedium.h"
+#include "UIExtraDataEventHandler.h"
 #ifdef Q_WS_MAC
 # include "DockIconPreview.h"
@@ -535,4 +536,9 @@
 }
 
+void UIMachineLogic::sltHidLedsSyncStateChanged(bool fEnabled)
+{
+    m_isHidLedsSyncEnabled = fEnabled;
+}
+
 void UIMachineLogic::sltKeyboardLedsChanged()
 {
@@ -647,5 +653,24 @@
 #endif /* Q_WS_MAC */
     , m_pHostLedsState(NULL)
-{
+    , m_isHidLedsSyncEnabled(false)
+{
+    /* Setup HID LEDs synchronization. */
+#if defined(Q_WS_MAC) || defined(Q_WS_WIN)
+    /* Read initial extradata value. */
+    QString strHidLedsSyncSettings = session().GetMachine().GetExtraData(GUI_HidLedsSync);
+
+    /* If extra data GUI/HidLedsSync is not present in VM config or set
+     * to 1 then sync is enabled. Otherwise, it is disabled. */
+    if (strHidLedsSyncSettings.isEmpty() || strHidLedsSyncSettings == "1")
+        m_isHidLedsSyncEnabled = true;
+    else
+        m_isHidLedsSyncEnabled = false;
+
+    /* Subscribe to GUI_HidLedsSync extradata changes in order to
+     * be able to enable or disable feature dynamically. */
+    connect(gEDataEvents, SIGNAL(sigHidLedsSyncStateChanged(bool)), this, SLOT(sltHidLedsSyncStateChanged(bool)));
+#else
+    m_isHidLedsSyncEnabled = false;
+#endif
 }
 
@@ -718,14 +743,4 @@
             pAction->setText(gpConverter->toString(pAction->data().value<KDragAndDropMode>()));
     }
-}
-
-bool UIMachineLogic::isHidLedsSyncEnabled()
-{
-    /** If extra data GUI/HidLedsSync is not present in VM config or set to 1 then sync is enabled. Otherwise, it is disabled. */
-    QString strHidLedsSyncSettings = session().GetMachine().GetExtraData(GUI_HidLedsSync);
-    if (strHidLedsSyncSettings.isEmpty() || strHidLedsSyncSettings == "1")
-        return true;
-
-    return false;
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 50682)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 50683)
@@ -99,5 +99,5 @@
 
     /** Performs HID LEDs sync. */
-    bool isHidLedsSyncEnabled();
+    bool isHidLedsSyncEnabled() { return m_isHidLedsSyncEnabled; };
 
 protected slots:
@@ -245,4 +245,5 @@
 
     /* Handlers: Keyboard LEDs sync logic: */
+    void sltHidLedsSyncStateChanged(bool fEnabled);
     void sltSwitchKeyboardLedsToGuestLeds();
     void sltSwitchKeyboardLedsToPreviousLeds();
@@ -290,4 +291,5 @@
 
     void *m_pHostLedsState;
+    bool m_isHidLedsSyncEnabled;
 
     /* Friend classes: */
