Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.ui	(revision 44519)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.ui	(revision 44520)
@@ -3,5 +3,5 @@
  VBox frontends: Qt4 GUI ("VirtualBox"):
 
- Copyright (C) 2008-2012 Oracle Corporation
+ Copyright (C) 2008-2013 Oracle Corporation
 
  This file is part of VirtualBox Open Source Edition (OSE), as
@@ -107,5 +107,5 @@
   <customwidget>
    <class>UIHotKeyEditor</class>
-   <extends>QLabel</extends>
+   <extends>QLineEdit</extends>
    <header>UIHotKeyEditor.h</header>
   </customwidget>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.cpp	(revision 44519)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.cpp	(revision 44520)
@@ -7,5 +7,5 @@
 
 /*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -18,9 +18,5 @@
  */
 
-/* Local includes */
-#include "UIHotKeyEditor.h"
-#include "VBoxGlobal.h"
-
-/* Global includes */
+/* Qt includes: */
 #include <QApplication>
 #include <QStyleOption>
@@ -28,4 +24,8 @@
 #include <QKeyEvent>
 #include <QTimer>
+
+/* GUI includes: */
+#include "UIHotKeyEditor.h"
+#include "VBoxGlobal.h"
 
 #ifdef Q_WS_WIN
@@ -299,5 +299,5 @@
 
 UIHotKeyEditor::UIHotKeyEditor(QWidget *pParent)
-    : QLabel(pParent)
+    : QLineEdit(pParent)
     , m_pReleaseTimer(0)
     , m_fStartNewSequence(true)
@@ -305,14 +305,7 @@
     /* Configure widget: */
     setAttribute(Qt::WA_NativeWindow);
-    setFrameStyle(QFrame::StyledPanel | Sunken);
     setAlignment(Qt::AlignCenter);
-    setFocusPolicy(Qt::StrongFocus);
-    setAutoFillBackground(true);
-
-    /* Setup palette: */
-    QPalette p = palette();
-    p.setColor(QPalette::Active, QPalette::Foreground, p.color(QPalette::Active, QPalette::Text));
-    p.setColor(QPalette::Active, QPalette::Background, p.color(QPalette::Active, QPalette::Base));
-    setPalette(p);
+    setContextMenuPolicy(Qt::NoContextMenu);
+    connect(this, SIGNAL(selectionChanged()), this, SLOT(sltDeselect()));
 
     /* Setup release-pending-keys timer: */
@@ -365,26 +358,7 @@
 }
 
-QSize UIHotKeyEditor::sizeHint() const
-{
-    ensurePolished();
-    QFontMetrics fm(font());
-    int h = qMax(fm.lineSpacing(), 14) + 2;
-    int w = fm.width('x') * 17;
-    int m = frameWidth() * 2;
-    QStyleOption option;
-    option.initFrom(this);
-    return (style()->sizeFromContents(QStyle::CT_LineEdit, &option,
-                                      QSize(w + m, h + m).expandedTo(QApplication::globalStrut()),
-                                      this));
-}
-
-QSize UIHotKeyEditor::minimumSizeHint() const
-{
-    ensurePolished();
-    QFontMetrics fm = fontMetrics();
-    int h = fm.height() + qMax(2, fm.leading());
-    int w = fm.maxWidth();
-    int m = frameWidth() * 2;
-    return QSize(w + m, h + m);
+void UIHotKeyEditor::sltDeselect()
+{
+    deselect();
 }
 
@@ -501,36 +475,42 @@
 #endif /* Q_WS_MAC */
 
-void UIHotKeyEditor::focusInEvent(QFocusEvent *pEvent)
-{
-    QLabel::focusInEvent(pEvent);
-
-    QPalette p = palette();
-    p.setColor(QPalette::Active, QPalette::Foreground, p.color(QPalette::Active, QPalette::HighlightedText));
-    p.setColor(QPalette::Active, QPalette::Background, p.color(QPalette::Active, QPalette::Highlight));
-    setPalette(p);
-}
-
-void UIHotKeyEditor::focusOutEvent(QFocusEvent *pEvent)
-{
-    QLabel::focusOutEvent(pEvent);
-
-    QPalette p = palette();
-    p.setColor(QPalette::Active, QPalette::Foreground, p.color(QPalette::Active, QPalette::Text));
-    p.setColor(QPalette::Active, QPalette::Background, p.color(QPalette::Active, QPalette::Base));
-    setPalette(p);
-}
-
-void UIHotKeyEditor::paintEvent(QPaintEvent *pEvent)
-{
-    if (hasFocus())
-    {
-        QStylePainter painter(this);
-        QStyleOptionFocusRect option;
-        option.initFrom(this);
-        option.backgroundColor = palette().color(QPalette::Background);
-        option.rect = contentsRect();
-        painter.drawPrimitive(QStyle::PE_FrameFocusRect, option);
-    }
-    QLabel::paintEvent(pEvent);
+void UIHotKeyEditor::keyPressEvent(QKeyEvent *pEvent)
+{
+    /* Ignore most of key presses... */
+    switch (pEvent->key())
+    {
+        case Qt::Key_Tab:
+        case Qt::Key_Backtab:
+        case Qt::Key_Escape:
+            return QLineEdit::keyPressEvent(pEvent);
+        default:
+            break;
+    }
+}
+
+void UIHotKeyEditor::keyReleaseEvent(QKeyEvent *pEvent)
+{
+    /* Ignore most of key presses... */
+    switch (pEvent->key())
+    {
+        case Qt::Key_Tab:
+        case Qt::Key_Backtab:
+        case Qt::Key_Escape:
+            return QLineEdit::keyReleaseEvent(pEvent);
+        default:
+            break;
+    }
+}
+
+void UIHotKeyEditor::mousePressEvent(QMouseEvent *pEvent)
+{
+    /* Handle like for usual QWidget: */
+    QWidget::mousePressEvent(pEvent);
+}
+
+void UIHotKeyEditor::mouseReleaseEvent(QMouseEvent *pEvent)
+{
+    /* Handle like for usual QWidget: */
+    QWidget::mouseReleaseEvent(pEvent);
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.h	(revision 44519)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.h	(revision 44520)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -20,6 +20,6 @@
 #define ___UIHotKeyEditor_h___
 
-/* Global includes */
-#include <QLabel>
+/* Qt includes: */
+#include <QLineEdit>
 #include <QMap>
 #include <QSet>
@@ -48,5 +48,5 @@
 }
 
-class UIHotKeyEditor : public QLabel
+class UIHotKeyEditor : public QLineEdit
 {
     Q_OBJECT;
@@ -55,14 +55,12 @@
 
     UIHotKeyEditor(QWidget *pParent);
-    virtual ~UIHotKeyEditor();
+    ~UIHotKeyEditor();
 
     void setCombo(const QString &strKeyCombo);
     QString combo() const;
 
-    QSize sizeHint() const;
-    QSize minimumSizeHint() const;
-
 public slots:
 
+    void sltDeselect();
     void sltClear();
 
@@ -80,7 +78,8 @@
 #endif /* Q_WS_MAC */
 
-    void focusInEvent(QFocusEvent *pEvent);
-    void focusOutEvent(QFocusEvent *pEvent);
-    void paintEvent(QPaintEvent *pEvent);
+    void keyPressEvent(QKeyEvent *pEvent);
+    void keyReleaseEvent(QKeyEvent *pEvent);
+    void mousePressEvent(QMouseEvent *pEvent);
+    void mouseReleaseEvent(QMouseEvent *pEvent);
 
 private slots:
@@ -100,9 +99,9 @@
     bool m_fStartNewSequence;
 
-#ifdef RT_OS_DARWIN
+#ifdef Q_WS_MAC
     /* 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 /* RT_OS_DARWIN */
+#endif /* Q_WS_MAC */
 };
 
