Index: /trunk/src/VBox/Frontends/VirtualBox/VirtualBox_xml.qrc
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/VirtualBox_xml.qrc	(revision 79313)
+++ /trunk/src/VBox/Frontends/VirtualBox/VirtualBox_xml.qrc	(revision 79314)
@@ -6,4 +6,5 @@
         <file alias="german.xml">xml/german.xml</file>
         <file alias="us.xml">xml/us.xml</file>
+        <file alias="numpad.xml">xml/numpad.xml</file>        
     </qresource>
 </RCC>
Index: /trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp	(revision 79313)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp	(revision 79314)
@@ -115,9 +115,18 @@
     QUuid    m_uId;
 
+    const QVector<UISoftKeyboardRow> &rows() const
+    {
+        return m_rows;
+    }
+
+    QVector<UISoftKeyboardRow> &rows()
+    {
+        return m_rows;
+    }
+
+private:
+
+    QString  m_strName;
     QVector<UISoftKeyboardRow>  m_rows;
-
-private:
-
-    QString  m_strName;
 };
 
@@ -466,4 +475,5 @@
     void saveCurentLayoutToFile();
     void copyCurentLayout();
+    float layoutAspectRation();
 
 protected:
@@ -490,5 +500,5 @@
     void               handleKeyPress(UISoftKeyboardKey *pKey);
     void               handleKeyRelease(UISoftKeyboardKey *pKey);
-    bool               loadPhysicalLayout(const QString &strLayoutFileName);
+    bool               loadPhysicalLayout(const QString &strLayoutFileName, bool isNumPad = false);
     bool               loadKeyboardLayout(const QString &strLayoutName);
     void               reset();
@@ -501,4 +511,5 @@
     /** Looks under the default keyboard layout folder and add the file names to the fileList. */
     void               lookAtDefaultLayoutFolder(QStringList &fileList);
+
     UISoftKeyboardKey *m_pKeyUnderMouse;
     UISoftKeyboardKey *m_pKeyBeingEdited;
@@ -512,4 +523,5 @@
     QVector<UISoftKeyboardKey*> m_pressedModifiers;
     QVector<UISoftKeyboardPhysicalLayout> m_physicalLayouts;
+    UISoftKeyboardPhysicalLayout          m_numPadLayout;
     QVector<UISoftKeyboardLayout>         m_layouts;
     UISoftKeyboardLayout *m_pCurrentKeyboardLayout;
@@ -1530,10 +1542,12 @@
 QSize UISoftKeyboardWidget::minimumSizeHint() const
 {
-    return QSize(0.5 * m_minimumSize.width(), 0.5 * m_minimumSize.height());
+    float fScale = 0.5f;
+    return QSize(fScale * m_minimumSize.width(), fScale * m_minimumSize.height());
 }
 
 QSize UISoftKeyboardWidget::sizeHint() const
 {
-    return QSize(0.5 * m_minimumSize.width(), 0.5 * m_minimumSize.height());
+    float fScale = 0.5f;
+    return QSize(fScale * m_minimumSize.width(), fScale * m_minimumSize.height());
 }
 
@@ -1541,5 +1555,4 @@
 {
     Q_UNUSED(pEvent);
-
     m_fScaleFactorX = width() / (float) m_iInitialWidth;
     m_fScaleFactorY = height() / (float) m_iInitialHeight;
@@ -1563,5 +1576,5 @@
         return;
 
-    QVector<UISoftKeyboardRow> &rows = pPhysicalLayout->m_rows;
+    QVector<UISoftKeyboardRow> &rows = pPhysicalLayout->rows();
     for (int i = 0; i < rows.size(); ++i)
     {
@@ -1711,5 +1724,5 @@
     xmlWriter.writeTextElement("physicallayoutid", pPhysicalLayout->m_uId.toString());
 
-    QVector<UISoftKeyboardRow> &rows = pPhysicalLayout->m_rows;
+    QVector<UISoftKeyboardRow> &rows = pPhysicalLayout->rows();
     for (int i = 0; i < rows.size(); ++i)
     {
@@ -1748,4 +1761,11 @@
 }
 
+float UISoftKeyboardWidget::layoutAspectRation()
+{
+    if (m_iInitialWidth == 0)
+        return 1.f;
+    return  m_iInitialHeight / (float) m_iInitialWidth;
+}
+
 void UISoftKeyboardWidget::deleteCurrentLayout()
 {
@@ -1860,5 +1880,5 @@
 
     UISoftKeyboardKey *pKey = 0;
-    QVector<UISoftKeyboardRow> &rows = pPhysicalLayout->m_rows;
+    QVector<UISoftKeyboardRow> &rows = pPhysicalLayout->rows();
     for (int i = 0; i < rows.size(); ++i)
     {
@@ -1968,13 +1988,19 @@
 }
 
-bool UISoftKeyboardWidget::loadPhysicalLayout(const QString &strLayoutFileName)
+bool UISoftKeyboardWidget::loadPhysicalLayout(const QString &strLayoutFileName, bool isNumPad /* = false */)
 {
     if (strLayoutFileName.isEmpty())
         return false;
     UIPhysicalLayoutReader reader;
-    m_physicalLayouts.append(UISoftKeyboardPhysicalLayout());
-    UISoftKeyboardPhysicalLayout &newPhysicalLayout = m_physicalLayouts.back();
-
-    if (!reader.parseXMLFile(strLayoutFileName, newPhysicalLayout))
+    UISoftKeyboardPhysicalLayout *newPhysicalLayout = 0;
+    if (!isNumPad)
+    {
+        m_physicalLayouts.append(UISoftKeyboardPhysicalLayout());
+        newPhysicalLayout = &(m_physicalLayouts.back());
+    }
+    else
+        newPhysicalLayout = &(m_numPadLayout);
+
+    if (!reader.parseXMLFile(strLayoutFileName, *newPhysicalLayout))
     {
         m_physicalLayouts.removeLast();
@@ -1982,10 +2008,25 @@
     }
 
+    if (isNumPad)
+        return true;
+
     int iY = m_iTopMargin;
     int iMaxWidth = 0;
-    QVector<UISoftKeyboardRow> &rows = newPhysicalLayout.m_rows;
+    const QVector<UISoftKeyboardRow> &numPadRows = m_numPadLayout.rows();
+    QVector<UISoftKeyboardRow> &rows = newPhysicalLayout->rows();
     for (int i = 0; i < rows.size(); ++i)
     {
         UISoftKeyboardRow &row = rows[i];
+        /* Start adding the numpad keys after the 0th row: */
+        if (i > 0)
+        {
+            int iNumPadRowIndex = i - 1;
+            if (iNumPadRowIndex < numPadRows.size())
+            {
+                for (int m = 0; m < numPadRows[iNumPadRowIndex].keys().size(); ++m)
+                    row.keys().append(numPadRows[iNumPadRowIndex].keys()[m]);
+            }
+        }
+
         int iX = m_iLeftMargin;
         int iRowHeight = row.defaultHeight();
@@ -2011,7 +2052,6 @@
     int iInitialWidth = iMaxWidth + m_iRightMargin;
     int iInitialHeight = iY + m_iBottomMargin;
-
-    setNewMinimumSize(QSize(iInitialWidth, iInitialHeight));
-    setInitialSize(iInitialWidth, iInitialHeight);
+    m_iInitialWidth = qMax(m_iInitialWidth, iInitialWidth);
+    m_iInitialHeight = qMax(m_iInitialHeight, iInitialHeight);
     return true;
 }
@@ -2059,8 +2099,12 @@
 {
     /* Load physical layouts from resources: */
+    loadPhysicalLayout(":/numpad.xml", true);
     QStringList physicalLayoutNames;
     physicalLayoutNames << ":/101_ansi.xml" << ":/102_iso.xml";
     foreach (const QString &strName, physicalLayoutNames)
         loadPhysicalLayout(strName);
+
+    setNewMinimumSize(QSize(m_iInitialWidth, m_iInitialHeight));
+    setInitialSize(m_iInitialWidth, m_iInitialHeight);
 
     /* Add keyboard layouts from resources: */
@@ -2134,5 +2178,5 @@
 
     /* Update the key captions: */
-    QVector<UISoftKeyboardRow> &rows = pPhysicalLayout->m_rows;
+    QVector<UISoftKeyboardRow> &rows = pPhysicalLayout->rows();
     for (int i = 0; i < rows.size(); ++i)
     {
@@ -2212,9 +2256,13 @@
     int iDefaultWidth = attributes.value("defaultWidth").toInt();
     int iDefaultHeight = attributes.value("defaultHeight").toInt();
-    QVector<UISoftKeyboardRow> &rows = physicalLayout.m_rows;
+    QVector<UISoftKeyboardRow> &rows = physicalLayout.rows();
+    int iRowCount = 0;
     while (m_xmlReader.readNextStartElement())
     {
         if (m_xmlReader.name() == "row")
+        {
             parseRow(iDefaultWidth, iDefaultHeight, rows);
+            ++iRowCount;
+        }
         else if (m_xmlReader.name() == "space")
             parseRowSpace(rows);
@@ -2766,7 +2814,11 @@
 void UISoftKeyboard::loadSettings()
 {
+    float fKeyboardAspectRatio = 1.0f;
+    if (m_pKeyboardWidget)
+        fKeyboardAspectRatio = m_pKeyboardWidget->layoutAspectRation();
+
     const QRect desktopRect = gpDesktop->availableGeometry(this);
     int iDefaultWidth = desktopRect.width() / 2;
-    int iDefaultHeight = desktopRect.height() * 3 / 4;
+    int iDefaultHeight = iDefaultWidth * fKeyboardAspectRatio;//desktopRect.height() * 3 / 4;
     QRect defaultGeometry(0, 0, iDefaultWidth, iDefaultHeight);
 
Index: /trunk/src/VBox/Frontends/VirtualBox/xml/101_ansi.xml
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/xml/101_ansi.xml	(revision 79313)
+++ /trunk/src/VBox/Frontends/VirtualBox/xml/101_ansi.xml	(revision 79314)
@@ -146,5 +146,4 @@
         <key>
             <width>110</width>
-
             <position>15</position>
             <scancode>0x0e</scancode>
@@ -168,9 +167,11 @@
             <scancode>0x49</scancode>
         </key>
-    </row>
-    <row>
-        <key>
-            <width>75</width>
-
+        <space>
+            <width>25</width>
+        </space>
+    </row>
+    <row>
+        <key>
+            <width>75</width>
             <position>16</position>
             <scancode>0x0f</scancode>
@@ -247,4 +248,7 @@
             <scancodeprefix>0xe0</scancodeprefix>
         </key>
+        <space>
+            <width>25</width>
+        </space>
     </row>
     <row>
@@ -306,4 +310,7 @@
             <scancode>0x1c</scancode>
         </key>
+        <space>
+            <width>220</width>
+        </space>
     </row>
     <row>
@@ -371,4 +378,7 @@
             <scancode>0x48</scancode>
         </key>
+        <space>
+            <width>80</width>
+        </space>
     </row>
     <row>
@@ -448,7 +458,7 @@
             <scancode>0x4d</scancode>
         </key>
-
-
-    </row>
-
+        <space>
+            <width>25</width>
+        </space>
+    </row>
 </physicallayout>
Index: /trunk/src/VBox/Frontends/VirtualBox/xml/102_iso.xml
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/xml/102_iso.xml	(revision 79313)
+++ /trunk/src/VBox/Frontends/VirtualBox/xml/102_iso.xml	(revision 79314)
@@ -164,4 +164,7 @@
             <scancode>0x49</scancode>
         </key>
+        <space>
+            <width>25</width>
+        </space>
     </row>
     <row>
@@ -223,5 +226,4 @@
             <width>85</width>
             <height>105</height>
-
             <position>43</position>
             <scancode>0x1c</scancode>
@@ -250,4 +252,7 @@
             <scancodeprefix>0xe0</scancodeprefix>
         </key>
+        <space>
+            <width>25</width>
+        </space>
     </row>
     <row>
@@ -307,4 +312,7 @@
             <scancode>0xff</scancode>
         </key>
+        <space>
+            <width>285</width>
+        </space>
     </row>
     <row>
@@ -376,4 +384,7 @@
             <scancode>0x48</scancode>
         </key>
+        <space>
+            <width>80</width>
+        </space>
     </row>
     <row>
@@ -453,4 +464,7 @@
             <scancode>0x4d</scancode>
         </key>
+        <space>
+            <width>25</width>
+        </space>
     </row>
 </physicallayout>
