Index: /trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp	(revision 79778)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp	(revision 79779)
@@ -540,5 +540,4 @@
     void keyStateChange(UISoftKeyboardKey* pKey);
     void loadLayouts();
-    void showContextMenu(const QPoint &globalPoint);
 
     void setCurrentLayout(const QString &strLayoutName);
@@ -584,5 +583,4 @@
 private slots:
 
-    void sltContextMenuRequest(const QPoint &point);
     void sltPhysicalLayoutForLayoutChanged(int iIndex);
 
@@ -597,4 +595,7 @@
     void               handleKeyPress(UISoftKeyboardKey *pKey);
     void               handleKeyRelease(UISoftKeyboardKey *pKey);
+    /** Sends usage id/page to API when a modifier key is right clicked. useful for testing and things like
+      * Window key press for start menu opening. This works orthogonal to left clicks.*/
+    void               modifierKeyPressRelease(UISoftKeyboardKey *pKey, bool fRelease);
     bool               loadPhysicalLayout(const QString &strLayoutFileName, bool isNumPad = false);
     bool               loadKeyboardLayout(const QString &strLayoutName);
@@ -634,5 +635,4 @@
     int   m_iBottomMargin;
 
-    QMenu   *m_pContextMenu;
     Mode     m_enmMode;
 
@@ -2020,5 +2020,4 @@
     , m_iRightMargin(10)
     , m_iBottomMargin(10)
-    , m_pContextMenu(0)
     , m_enmMode(Mode_Keyboard)
     , m_fShowOSMenuKeys(true)
@@ -2125,12 +2124,22 @@
 {
     QWidget::mousePressEvent(pEvent);
-    if (pEvent->button() != Qt::LeftButton)
-        return;
+    if (pEvent->button() != Qt::RightButton && pEvent->button() != Qt::LeftButton)
+        return;
+
     m_pKeyPressed = keyUnderMouse(pEvent);
-
-    if (m_enmMode == Mode_Keyboard)
-        handleKeyPress(m_pKeyPressed);
-    else if (m_enmMode == Mode_LayoutEdit)
-        setKeyBeingEdited(m_pKeyUnderMouse);
+    if (!m_pKeyPressed)
+        return;
+
+    /* Handling the right button press: */
+    if (pEvent->button() == Qt::RightButton)
+        modifierKeyPressRelease(m_pKeyPressed, false);
+    else
+    {
+        /* Handling the left button press: */
+        if (m_enmMode == Mode_Keyboard)
+            handleKeyPress(m_pKeyPressed);
+        else if (m_enmMode == Mode_LayoutEdit)
+            setKeyBeingEdited(m_pKeyUnderMouse);
+    }
     update();
 }
@@ -2139,14 +2148,19 @@
 {
     QWidget::mouseReleaseEvent(pEvent);
-    if (pEvent->button() != Qt::LeftButton)
-        return;
+
+    if (pEvent->button() != Qt::RightButton && pEvent->button() != Qt::LeftButton)
+        return;
+
     if (!m_pKeyPressed)
         return;
-
-    if (m_enmMode == Mode_Keyboard)
-        handleKeyRelease(m_pKeyPressed);
-
+    if (pEvent->button() == Qt::RightButton)
+        modifierKeyPressRelease(m_pKeyPressed, true);
+    else
+    {
+        if (m_enmMode == Mode_Keyboard)
+            handleKeyRelease(m_pKeyPressed);
+    }
+    m_pKeyPressed = 0;
     update();
-    m_pKeyPressed = 0;
 }
 
@@ -2159,9 +2173,4 @@
 void UISoftKeyboardWidget::retranslateUi()
 {
-}
-
-void UISoftKeyboardWidget::sltContextMenuRequest(const QPoint &point)
-{
-    showContextMenu(mapToGlobal(point));
 }
 
@@ -2539,4 +2548,18 @@
 }
 
+void UISoftKeyboardWidget::modifierKeyPressRelease(UISoftKeyboardKey *pKey, bool fRelease)
+{
+    if (!pKey || pKey->type() != KeyType_Modifier)
+        return;
+    if (pKey->state() != KeyState_NotPressed)
+        return;
+    QVector<QPair<LONG, LONG> > sequence;
+    sequence << pKey->usagePageIdPair();
+    if (fRelease)
+        emit sigPutUsageCodesPress(sequence);
+    else
+        emit sigPutUsageCodesRelease(sequence);
+}
+
 void UISoftKeyboardWidget::keyStateChange(UISoftKeyboardKey* pKey)
 {
@@ -2551,10 +2574,4 @@
                 m_pressedModifiers.append(pKey);
     }
-}
-
-void UISoftKeyboardWidget::showContextMenu(const QPoint &globalPoint)
-{
-    m_pContextMenu->exec(globalPoint);
-    update();
 }
 
@@ -2783,10 +2800,5 @@
 void UISoftKeyboardWidget::prepareObjects()
 {
-    m_pContextMenu = new QMenu(this);
-
     setMouseTracking(true);
-    setContextMenuPolicy(Qt::CustomContextMenu);
-    connect(this, &UISoftKeyboardWidget::customContextMenuRequested,
-            this, &UISoftKeyboardWidget::sltContextMenuRequest);
 }
 
@@ -3485,10 +3497,4 @@
 }
 
-void UISoftKeyboard::sltStatusBarContextMenuRequest(const QPoint &point)
-{
-    if (m_pKeyboardWidget)
-        m_pKeyboardWidget->showContextMenu(statusBar()->mapToGlobal(point));
-}
-
 void UISoftKeyboard::sltLayoutSelectionChanged(const QUuid &layoutUid)
 {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h	(revision 79778)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h	(revision 79779)
@@ -70,5 +70,4 @@
     void sltPutUsageCodesRelease(QVector<QPair<LONG, LONG> > sequence);
 
-    void sltStatusBarContextMenuRequest(const QPoint &point);
     /** Handles the signal we get from the layout selector widget.
       * Selection changed is forwarded to the keyboard widget. */
