Changeset 78812 in vbox
- Timestamp:
- May 28, 2019 11:32:39 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 130908
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VirtualBox_xml.qrc
r78567 r78812 2 2 <qresource suffix="/"> 3 3 <file alias="us_layout.xml">xml/us_layout.xml</file> 4 <file alias="102_iso.xml">xml/102_iso.xml</file> 4 5 </qresource> 5 6 </RCC> -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r78635 r78812 64 64 #include "UIFileManagerDialog.h" 65 65 #include "UIGuestProcessControlDialog.h" 66 #include "UISoftKeyboard Dialog.h"66 #include "UISoftKeyboard.h" 67 67 #ifdef VBOX_WS_MAC 68 68 # include "DockIconPreview.h" … … 1607 1607 return; 1608 1608 1609 QIManagerDialog *pSoftKeyboardDialog;1610 UISoftKeyboardDialogFactory dialogFactory(uisession(), actionPool(), machine().GetName());1611 dialogFactory.prepare(pSoftKeyboardDialog, activeMachineWindow());1612 if (pSoftKeyboard Dialog)1613 { 1614 m_pSoftKeyboardDialog = pSoftKeyboardDialog;1609 UISoftKeyboard *pSoftKeyboard = new UISoftKeyboard(0, uisession(), machine().GetName()); 1610 // UISoftKeyboardDialogFactory dialogFactory(uisession(), actionPool(), machine().GetName()); 1611 // dialogFactory.prepare(pSoftKeyboardDialog, activeMachineWindow()); 1612 if (pSoftKeyboard) 1613 { 1614 //m_pSoftKeyboardDialog = pSoftKeyboardDialog; 1615 1615 1616 1616 /* Show instance: */ 1617 pSoftKeyboard Dialog->show();1618 pSoftKeyboardDialog->setWindowState(pSoftKeyboardDialog->windowState() & ~Qt::WindowMinimized);1619 pSoftKeyboardDialog->activateWindow();1620 connect(pSoftKeyboardDialog, &QIManagerDialog::sigClose,1621 this, &UIMachineLogic::sltCloseSoftKeyboard);1617 pSoftKeyboard->show(); 1618 // pSoftKeyboardDialog->setWindowState(pSoftKeyboardDialog->windowState() & ~Qt::WindowMinimized); 1619 // pSoftKeyboardDialog->activateWindow(); 1620 // connect(pSoftKeyboardDialog, &QIManagerDialog::sigClose, 1621 // this, &UIMachineLogic::sltCloseSoftKeyboard); 1622 1622 } 1623 1623 } … … 1625 1625 void UIMachineLogic::sltCloseSoftKeyboard() 1626 1626 { 1627 QIManagerDialog* pDialog = qobject_cast<QIManagerDialog*>(sender());1628 if (m_pSoftKeyboardDialog != pDialog || !pDialog)1629 return;1630 1631 / * Set the m_pSoftKeyboardDialog to NULL before closing the dialog. or we will have redundant deletes*/1632 m_pSoftKeyboardDialog = 0;1633 pDialog->close();1634 UISoftKeyboardDialogFactory().cleanup(pDialog);1627 // QIManagerDialog* pDialog = qobject_cast<QIManagerDialog*>(sender()); 1628 // if (m_pSoftKeyboardDialog != pDialog || !pDialog) 1629 // return; 1630 1631 // /* Set the m_pSoftKeyboardDialog to NULL before closing the dialog. or we will have redundant deletes*/ 1632 // m_pSoftKeyboardDialog = 0; 1633 // pDialog->close(); 1634 // UISoftKeyboardDialogFactory().cleanup(pDialog); 1635 1635 } 1636 1636 -
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp
r78685 r78812 36 36 #include "CEventSource.h" 37 37 38 class UISoftKeyboardWidget : public QWidget 39 { 40 Q_OBJECT; 41 public: 42 43 virtual QSize minimumSizeHint() const 44 { 45 return m_minimumSize; 46 } 47 48 virtual QSize sizeHint() const 49 { 50 return m_minimumSize; 51 } 52 53 void setNewMinimumSize(const QSize &size) 54 { 55 m_minimumSize = size; 56 updateGeometry(); 57 } 58 59 private: 60 61 QSize m_minimumSize; 62 }; 38 63 enum UIKeyState 39 64 { … … 56 81 struct SoftKeyboardKey 57 82 { 83 /** Width and height might be inherited from the row and/or overwritten in row settings. */ 58 84 int m_iWidth; 59 QString m_strLabel; 60 LONG m_scanCode; 61 LONG m_scanCodePrefix; 62 int m_iSpaceAfter; 85 int m_iHeight; 86 LONG m_strScanCode; 87 LONG m_strScanCodePrefix; 63 88 UIKeyType m_enmType; 89 QString m_strKeyCap; 90 int m_iSpaceWidthAfter; 91 int m_iCutoutWidth; 92 int m_iCutoutHeight; 93 /** -1 is no cutout. 0 is the topleft corner. we go clockwise. */ 94 int m_iCutoutCorner; 64 95 }; 65 96 66 97 struct SoftKeyboardRow 67 98 { 68 int m_iHeight; 99 /** Default width and height might be inherited from the layout and overwritten in row settings. */ 100 int m_iDefaultWidth; 101 int m_iDefaultHeight; 69 102 int m_iStartingSpace; 70 103 QList<SoftKeyboardKey> m_keys; … … 73 106 struct SoftKeyboardLayout 74 107 { 108 int m_iDefaultWidth; 109 int m_iDefaultHeight; 75 110 QList<SoftKeyboardRow> m_rows; 76 };77 78 /*********************************************************************************************************************************79 * UIKeyboardLayoutReader definition. *80 *********************************************************************************************************************************/81 82 class UIKeyboardLayoutReader83 {84 85 public:86 87 bool parseXMLFile(const QString &strFileName, SoftKeyboardLayout &layout);88 89 private:90 91 bool parseRow(SoftKeyboardLayout &layout);92 bool parseSpace(SoftKeyboardRow &row);93 bool parseKey(SoftKeyboardRow &row);94 QXmlStreamReader m_xmlReader;95 111 }; 96 112 … … 134 150 135 151 void release(); 152 void setVertices(const QVector<QPoint> &vertices); 136 153 137 154 protected: … … 154 171 UIKeyState m_enmState; 155 172 QPalette m_defaultPalette; 156 float m_fScaleMultiplier; 173 float m_fScaleMultiplier; 174 QVector<QPoint> m_vertices; 157 175 }; 158 176 159 177 /********************************************************************************************************************************* 160 * UI SoftKeyboardRowdefinition. *178 * UIKeyboardLayoutReader definition. * 161 179 *********************************************************************************************************************************/ 162 180 163 class UISoftKeyboardRow : public QWidget 164 { 165 Q_OBJECT; 181 class UIKeyboardLayoutReader 182 { 166 183 167 184 public: 168 185 169 UISoftKeyboardRow(QWidget *pParent = 0); 170 void updateLayout(); 171 void setKeepAspectRatio(bool fKeepAspectRatio); 172 173 void setUnscaledWidth(int iWidth); 174 int unscaledWidth() const; 175 176 void setUnscaledHeight(int iWidth); 177 int unscaledHeight() const; 178 179 void addKey(UISoftKeyboardKey *pKey); 180 186 bool parseXMLFile(const QString &strFileName, SoftKeyboardLayout &layout); 187 static QVector<QPoint> computeKeyVertices(const SoftKeyboardKey &key); 181 188 private: 182 189 183 int m_iWidth; 184 int m_iHeight; 185 QVector<UISoftKeyboardKey*> m_keys; 186 bool m_fKeepAspectRatio; 190 void parseKey(SoftKeyboardRow &row); 191 void parseRow(SoftKeyboardLayout &layout); 192 void parseSpace(SoftKeyboardRow &row); 193 void parseCutout(SoftKeyboardKey &key); 194 195 QXmlStreamReader m_xmlReader; 187 196 }; 188 197 … … 205 214 return false; 206 215 216 QXmlStreamAttributes attributes = m_xmlReader.attributes(); 217 layout.m_iDefaultWidth = attributes.value("defaultWidth").toInt(); 218 layout.m_iDefaultHeight = attributes.value("defaultHeight").toInt(); 219 207 220 while (m_xmlReader.readNextStartElement()) 208 221 { 209 222 if (m_xmlReader.name() == "row") 223 { 210 224 parseRow(layout); 225 } 211 226 else 212 227 m_xmlReader.skipCurrentElement(); … … 216 231 } 217 232 218 bool UIKeyboardLayoutReader::parseRow(SoftKeyboardLayout &layout) 219 { 220 layout.m_rows.append(SoftKeyboardRow()); 221 SoftKeyboardRow &row = layout.m_rows.last(); 222 row.m_iHeight = 0; 223 row.m_iStartingSpace = 0; 233 void UIKeyboardLayoutReader::parseRow(SoftKeyboardLayout &layout) 234 { 235 SoftKeyboardRow row; 236 237 row.m_iDefaultWidth = layout.m_iDefaultWidth; 238 row.m_iDefaultHeight = layout.m_iDefaultHeight; 239 240 /* Override the layout attributes if the row also has them: */ 241 QXmlStreamAttributes attributes = m_xmlReader.attributes(); 242 if (attributes.hasAttribute("defaultWidth")) 243 row.m_iDefaultWidth = attributes.value("defaultWidth").toInt(); 244 if (attributes.hasAttribute("defaultHeight")) 245 row.m_iDefaultHeight = attributes.value("defaultHeight").toInt(); 224 246 while (m_xmlReader.readNextStartElement()) 225 247 { … … 228 250 else if (m_xmlReader.name() == "space") 229 251 parseSpace(row); 230 else if (m_xmlReader.name() == "height")231 row.m_iHeight = m_xmlReader.readElementText().toInt();232 252 else 233 253 m_xmlReader.skipCurrentElement(); 234 254 } 235 return true; 236 } 237 238 bool UIKeyboardLayoutReader::parseSpace(SoftKeyboardRow &row) 239 { 240 while (m_xmlReader.readNextStartElement()) 241 { 242 if (m_xmlReader.name() == "width") 243 { 244 int iSpace = m_xmlReader.readElementText().toInt(); 245 /* Find the key that comes before this space (if any): */ 246 if (!row.m_keys.isEmpty()) 247 row.m_keys.back().m_iSpaceAfter = iSpace; 248 /* If there are no keys yet, start the row with a space: */ 249 else 250 row.m_iStartingSpace = iSpace; 251 } 252 else 253 m_xmlReader.skipCurrentElement(); 254 } 255 return true; 256 } 257 258 bool UIKeyboardLayoutReader::parseKey(SoftKeyboardRow &row) 259 { 260 row.m_keys.append(SoftKeyboardKey()); 261 SoftKeyboardKey &key = row.m_keys.last(); 262 key.m_scanCode = 0; 263 key.m_scanCodePrefix = 0; 264 key.m_iSpaceAfter = 0; 265 key.m_enmType = UIKeyType_Ordinary; 266 255 layout.m_rows.append(row); 256 } 257 258 void UIKeyboardLayoutReader::parseKey(SoftKeyboardRow &row) 259 { 260 SoftKeyboardKey key; 261 key.m_iWidth = row.m_iDefaultWidth; 262 key.m_iHeight = row.m_iDefaultHeight; 263 key.m_iSpaceWidthAfter = 0; 264 key.m_iCutoutCorner = -1; 267 265 while (m_xmlReader.readNextStartElement()) 268 266 { 269 267 if (m_xmlReader.name() == "width") 270 268 key.m_iWidth = m_xmlReader.readElementText().toInt(); 271 else if (m_xmlReader.name() == "label") 272 { 273 if (key.m_strLabel.isEmpty()) 274 key.m_strLabel = m_xmlReader.readElementText(); 275 else 276 key.m_strLabel = QString("%1%2%3").arg(key.m_strLabel).arg("\n").arg(m_xmlReader.readElementText()); 277 } 269 else if (m_xmlReader.name() == "height") 270 key.m_iHeight = m_xmlReader.readElementText().toInt(); 278 271 else if (m_xmlReader.name() == "scancode") 279 272 { 280 273 QString strCode = m_xmlReader.readElementText(); 281 274 bool fOk = false; 282 key.m_scanCode = strCode.toInt(&fOk, 16); 283 if (!fOk) 284 key.m_scanCode = 0; 275 key.m_strScanCode = strCode.toInt(&fOk, 16); 285 276 } 286 277 else if (m_xmlReader.name() == "scancodeprefix") … … 288 279 QString strCode = m_xmlReader.readElementText(); 289 280 bool fOk = false; 290 key.m_scanCodePrefix = strCode.toInt(&fOk, 16); 291 if (!fOk) 292 key.m_scanCodePrefix = 0; 281 key.m_strScanCodePrefix = strCode.toInt(&fOk, 16); 293 282 } 294 else if (m_xmlReader.name() == " type")283 else if (m_xmlReader.name() == "keycap") 295 284 { 296 QString strType = m_xmlReader.readElementText(); 297 if (strType == "modifier") 298 key.m_enmType = UIKeyType_Modifier; 299 else if (strType == "toggleable") 300 key.m_enmType = UIKeyType_Toggleable; 285 if (key.m_strKeyCap.isEmpty()) 286 key.m_strKeyCap = m_xmlReader.readElementText(); 287 else 288 key.m_strKeyCap += "\n" + m_xmlReader.readElementText(); 289 } 290 else if (m_xmlReader.name() == "cutout") 291 parseCutout(key); 292 293 294 // else if (m_xmlReader.name() == "type") 295 // { 296 // QString strType = m_xmlReader.readElementText(); 297 // if (strType == "modifier") 298 // pKey->setType(UIKeyType_Modifier); 299 // else if (strType == "toggleable") 300 // pKey->setType(UIKeyType_Toggleable); 301 // } 302 else 303 m_xmlReader.skipCurrentElement(); 304 } 305 row.m_keys.append(key); 306 } 307 308 void UIKeyboardLayoutReader::parseSpace(SoftKeyboardRow &row) 309 { 310 int iWidth = row.m_iDefaultWidth; 311 while (m_xmlReader.readNextStartElement()) 312 { 313 if (m_xmlReader.name() == "width") 314 iWidth = m_xmlReader.readElementText().toInt(); 315 else 316 m_xmlReader.skipCurrentElement(); 317 } 318 if (row.m_keys.size() <= 0) 319 return; 320 row.m_keys.back().m_iSpaceWidthAfter = iWidth; 321 } 322 323 void UIKeyboardLayoutReader::parseCutout(SoftKeyboardKey &key) 324 { 325 while (m_xmlReader.readNextStartElement()) 326 { 327 if (m_xmlReader.name() == "width") 328 key.m_iCutoutWidth = m_xmlReader.readElementText().toInt(); 329 else if (m_xmlReader.name() == "height") 330 key.m_iCutoutHeight = m_xmlReader.readElementText().toInt(); 331 else if (m_xmlReader.name() == "corner") 332 { 333 QString strCorner = m_xmlReader.readElementText(); 334 if (strCorner == "topLeft") 335 key.m_iCutoutCorner = 0; 336 else if(strCorner == "topRight") 337 key.m_iCutoutCorner = 1; 338 else if(strCorner == "bottomRight") 339 key.m_iCutoutCorner = 2; 340 else if(strCorner == "bottomLeft") 341 key.m_iCutoutCorner = 3; 301 342 } 302 343 else 303 344 m_xmlReader.skipCurrentElement(); 304 345 } 305 return true; 306 } 346 } 347 348 QVector<QPoint> UIKeyboardLayoutReader::computeKeyVertices(const SoftKeyboardKey &key) 349 { 350 QVector<QPoint> vertices; 351 352 if (key.m_iCutoutCorner == -1 || key.m_iWidth <= key.m_iCutoutWidth || key.m_iHeight <= key.m_iCutoutHeight) 353 { 354 vertices.append(QPoint(0, 0)); 355 vertices.append(QPoint(key.m_iWidth, 0)); 356 vertices.append(QPoint(key.m_iWidth, key.m_iHeight)); 357 vertices.append(QPoint(0, key.m_iHeight)); 358 return vertices; 359 } 360 if (key.m_iCutoutCorner == 0) 361 { 362 vertices.append(QPoint(key.m_iCutoutWidth, 0)); 363 vertices.append(QPoint(key.m_iWidth, 0)); 364 vertices.append(QPoint(key.m_iWidth, key.m_iHeight)); 365 vertices.append(QPoint(0, key.m_iHeight)); 366 vertices.append(QPoint(0, key.m_iCutoutHeight)); 367 vertices.append(QPoint(key.m_iCutoutWidth, key.m_iCutoutHeight)); 368 } 369 else if (key.m_iCutoutCorner == 1) 370 { 371 vertices.append(QPoint(0, 0)); 372 vertices.append(QPoint(key.m_iWidth - key.m_iCutoutWidth, 0)); 373 vertices.append(QPoint(key.m_iWidth - key.m_iCutoutWidth, key.m_iCutoutHeight)); 374 vertices.append(QPoint(key.m_iWidth, key.m_iCutoutHeight)); 375 vertices.append(QPoint(key.m_iWidth, key.m_iHeight)); 376 vertices.append(QPoint(0, key.m_iHeight)); 377 } 378 else if (key.m_iCutoutCorner == 2) 379 { 380 vertices.append(QPoint(0, 0)); 381 vertices.append(QPoint(key.m_iWidth, 0)); 382 vertices.append(QPoint(key.m_iWidth, key.m_iCutoutHeight)); 383 vertices.append(QPoint(key.m_iWidth - key.m_iCutoutWidth, key.m_iCutoutHeight)); 384 vertices.append(QPoint(key.m_iWidth - key.m_iCutoutWidth, key.m_iHeight)); 385 vertices.append(QPoint(0, key.m_iHeight)); 386 } 387 else if (key.m_iCutoutCorner == 3) 388 { 389 vertices.append(QPoint(0, 0)); 390 vertices.append(QPoint(key.m_iWidth, 0)); 391 vertices.append(QPoint(key.m_iWidth, key.m_iHeight)); 392 vertices.append(QPoint(key.m_iCutoutWidth, key.m_iHeight)); 393 vertices.append(QPoint(key.m_iCutoutWidth, key.m_iHeight - key.m_iCutoutHeight)); 394 vertices.append(QPoint(0, key.m_iHeight - key.m_iCutoutHeight)); 395 } 396 return vertices; 397 } 398 307 399 308 400 /********************************************************************************************************************************* … … 387 479 void UISoftKeyboardKey::updateFontSize() 388 480 { 481 QFont newFont = font(); 389 482 if (m_iDefaultPointSize != -1) 390 {391 QFont newFont = font();392 483 newFont.setPointSize(m_fScaleMultiplier * m_iDefaultPointSize); 393 setFont(newFont);394 }395 484 else 396 {397 QFont newFont = font();398 485 newFont.setPixelSize(m_fScaleMultiplier * m_iDefaultPixelSize); 399 setFont(newFont); 400 } 486 setFont(newFont); 401 487 } 402 488 … … 404 490 { 405 491 updateState(false); 492 } 493 494 void UISoftKeyboardKey::setVertices(const QVector<QPoint> &vertices) 495 { 496 m_vertices = vertices; 406 497 } 407 498 … … 414 505 void UISoftKeyboardKey::paintEvent(QPaintEvent *pEvent) 415 506 { 416 QToolButton::paintEvent(pEvent); 417 418 if (m_enmType == UIKeyType_Ordinary) 419 return; 420 507 Q_UNUSED(pEvent); 508 // QToolButton::paintEvent(pEvent); 509 // return; 421 510 QPainter painter(this); 422 painter.setRenderHint(QPainter::Antialiasing, true); 423 424 painter.setPen(QPen(QColor(50, 50, 50), 0.2f)); 425 if (m_enmState == UIKeyState_NotPressed) 426 painter.setBrush(QColor(100, 100, 100)); 427 else if (m_enmState == UIKeyState_Pressed) 428 painter.setBrush(QColor(20, 255, 42)); 429 else 430 painter.setBrush(QColor(255, 7, 58)); 431 432 int unitSize = qApp->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing); 433 434 float fRadius = m_fScaleMultiplier * 1.1 * unitSize; 435 float fSpace = m_fScaleMultiplier * unitSize; 436 QRectF rectangle(fSpace, fSpace, fRadius, fRadius); 437 438 painter.drawEllipse(rectangle); 511 QFont painterFont(font()); 512 painterFont.setPixelSize(16); 513 painter.setFont(painterFont); 514 515 painter.setRenderHint(QPainter::Antialiasing); 516 painter.setPen(QPen(QColor(0, 0,0), 2)); 517 painter.setBrush(QBrush(QColor(255, 0,0))); 518 painter.drawPolygon(&(m_vertices[0]), m_vertices.size()); 519 QRect textRect(0, 0, width(), height()); 520 painter.drawText(textRect, Qt::TextWordWrap, text()); 439 521 } 440 522 … … 496 578 } 497 579 498 /*********************************************************************************************************************************499 * UISoftKeyboardRow implementation. *500 *********************************************************************************************************************************/501 502 UISoftKeyboardRow::UISoftKeyboardRow(QWidget *pParent /* = 0 */)503 :QWidget(pParent)504 , m_iWidth(0)505 , m_iHeight(0)506 , m_fKeepAspectRatio(false)507 {508 }509 510 void UISoftKeyboardRow::setKeepAspectRatio(bool fKeepAspectRatio)511 {512 m_fKeepAspectRatio = fKeepAspectRatio;513 }514 515 void UISoftKeyboardRow::setUnscaledWidth(int iWidth)516 {517 m_iWidth = iWidth;518 }519 520 int UISoftKeyboardRow::unscaledWidth() const521 {522 return m_iWidth;523 }524 525 void UISoftKeyboardRow::setUnscaledHeight(int iHeight)526 {527 m_iHeight = iHeight;528 }529 530 int UISoftKeyboardRow::unscaledHeight() const531 {532 return m_iHeight;533 }534 535 void UISoftKeyboardRow::addKey(UISoftKeyboardKey *pKey)536 {537 m_keys.append(pKey);538 }539 540 void UISoftKeyboardRow::updateLayout()541 {542 if (m_iHeight == 0)543 return;544 545 546 float fMultiplier = 1;547 if (m_fKeepAspectRatio)548 fMultiplier = height() / (float)m_iHeight;549 else550 fMultiplier = width() / (float)m_iWidth;551 int iX = 0;552 for (int i = 0; i < m_keys.size(); ++i)553 {554 UISoftKeyboardKey *pKey = m_keys[i];555 if (!pKey)556 continue;557 pKey->setVisible(true);558 pKey->setScaleMultiplier(fMultiplier);559 pKey->updateFontSize();560 int iKeyWidth = fMultiplier * pKey->width();561 if (i != m_keys.size() - 1)562 pKey->setGeometry(iX, 0, iKeyWidth, height());563 else564 {565 pKey->setGeometry(iX, 0, width() - iX - 1, height());566 }567 iX += fMultiplier * pKey->width();568 iX += fMultiplier * pKey->spaceAfter();569 }570 }571 572 580 /********************************************************************************************************************************* 573 581 * UISoftKeyboard implementation. * 574 582 *********************************************************************************************************************************/ 575 583 576 UISoftKeyboard::UISoftKeyboard(EmbedTo /* enmEmbedding */, QWidget *pParent, 577 UISession *pSession, QString strMachineName /* = QString()*/, 578 bool fShowToolbar /* = false */) 579 :QIWithRetranslateUI<QWidget>(pParent) 584 UISoftKeyboard::UISoftKeyboard(QWidget *pParent, 585 UISession *pSession, QString strMachineName /* = QString()*/) 586 :QIWithRetranslateUI<QMainWindow>(pParent) 580 587 , m_pSession(pSession) 581 588 , m_pMainLayout(0) 582 589 , m_pContainerWidget(0) 583 , m_pToolBar(0)584 , m_fShowToolbar(fShowToolbar)585 590 , m_strMachineName(strMachineName) 586 591 , m_iTotalRowHeight(0) 587 592 , m_iMaxRowWidth(0) 588 593 , m_fKeepAspectRatio(false) 589 { 594 , m_iXSpacing(5) 595 , m_iYSpacing(5) 596 , m_iLeftMargin(5) 597 , m_iTopMargin(5) 598 , m_iRightMargin(5) 599 , m_iBottomMargin(5) 600 { 601 setAttribute(Qt::WA_DeleteOnClose); 590 602 prepareObjects(); 591 603 parseLayout(); … … 607 619 void UISoftKeyboard::resizeEvent(QResizeEvent *pEvent) 608 620 { 609 QIWithRetranslateUI<Q Widget>::resizeEvent(pEvent);610 updateLayout();621 QIWithRetranslateUI<QMainWindow>::resizeEvent(pEvent); 622 //updateLayout(); 611 623 } 612 624 … … 683 695 void UISoftKeyboard::prepareObjects() 684 696 { 685 setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); 697 686 698 /* Create layout: */ 687 m_pMainLayout = new QHBoxLayout(this);688 if (!m_pMainLayout)689 return;690 m_pContainerWidget = new QWidget;699 // m_pMainLayout = new QHBoxLayout(this); 700 // if (!m_pMainLayout) 701 // return; 702 m_pContainerWidget = new UISoftKeyboardWidget; 691 703 if (!m_pContainerWidget) 692 704 return; 693 //m_pContainerWidget->setStyleSheet("background-color:red;"); 694 m_pMainLayout->addWidget(m_pContainerWidget); 705 m_pContainerWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); 706 707 m_pContainerWidget->setStyleSheet("background-color:red;"); 708 //m_pMainLayout->addWidget(m_pContainerWidget); 709 setCentralWidget(m_pContainerWidget); 710 711 m_pContainerWidget->updateGeometry(); 695 712 } 696 713 … … 715 732 UIKeyboardLayoutReader reader; 716 733 SoftKeyboardLayout layout; 717 if (!reader.parseXMLFile(":/us_layout.xml", layout)) 718 return; 719 720 m_iTotalRowHeight = 0; 721 m_iMaxRowWidth = 0; 722 qDeleteAll(m_rows); 723 m_rows.clear(); 734 layout.m_iDefaultWidth = 0; 735 layout.m_iDefaultHeight = 0; 736 if (!reader.parseXMLFile(":/102_iso.xml", layout)) 737 return; 738 int iY = m_iTopMargin; 739 int iMaxWidth = 0; 724 740 for (int i = 0; i < layout.m_rows.size(); ++i) 725 741 { 726 UISoftKeyboardRow *pNewRow = new UISoftKeyboardRow(m_pContainerWidget); 727 m_rows.push_back(pNewRow); 728 pNewRow->setUnscaledHeight(layout.m_rows[i].m_iHeight); 729 pNewRow->setKeepAspectRatio(m_fKeepAspectRatio); 730 m_iTotalRowHeight += layout.m_rows[i].m_iHeight; 731 int iRowWidth = 0; 732 for (int j = 0; j < layout.m_rows[i].m_keys.size(); ++j) 742 m_keys.append(QVector<UISoftKeyboardKey*>()); 743 const SoftKeyboardRow &row = layout.m_rows[i]; 744 int iX = m_iLeftMargin; 745 QVector<UISoftKeyboardKey*> &rowKeyVector = m_keys.back(); 746 int iRowHeight = row.m_iDefaultHeight; 747 for (int j = 0; j < row.m_keys.size(); ++j) 733 748 { 734 const SoftKeyboardKey &key = layout.m_rows[i].m_keys[j]; 735 iRowWidth += key.m_iWidth; 736 iRowWidth += key.m_iSpaceAfter; 737 UISoftKeyboardKey *pKey = new UISoftKeyboardKey(pNewRow); 738 if (!pKey) 739 continue; 740 connect(pKey, &UISoftKeyboardKey::pressed, this, &UISoftKeyboard::sltHandleKeyPress); 741 connect(pKey, &UISoftKeyboardKey::released, this, &UISoftKeyboard::sltHandleKeyRelease); 742 connect(pKey, &UISoftKeyboardKey::sigStateChanged, this, &UISoftKeyboard::sltHandleModifierStateChange); 743 pNewRow->addKey(pKey); 744 pKey->setText(key.m_strLabel); 749 const SoftKeyboardKey &key = row.m_keys[j]; 750 UISoftKeyboardKey *pKey = new UISoftKeyboardKey(m_pContainerWidget); 751 rowKeyVector.append(pKey); 752 pKey->setText(key.m_strKeyCap); 753 pKey->setGeometry(iX, iY, key.m_iWidth, key.m_iHeight); 745 754 pKey->setWidth(key.m_iWidth); 746 pKey->setScanCode(key.m_scanCode); 747 pKey->setScanCodePrefix(key.m_scanCodePrefix); 748 pKey->setSpaceAfter(key.m_iSpaceAfter); 749 pKey->setType(key.m_enmType); 750 pKey->hide(); 755 // printf("key.m_iWidth %d\n", pKey->width()); 756 pKey->setVertices(UIKeyboardLayoutReader::computeKeyVertices(key)); 757 iX += key.m_iWidth; 758 if (j < row.m_keys.size() - 1) 759 iX += m_iXSpacing; 760 if (key.m_iSpaceWidthAfter != 0) 761 iX += (m_iXSpacing + key.m_iSpaceWidthAfter); 762 iRowHeight = qMax(iRowHeight, key.m_iHeight); 751 763 } 752 pNewRow->setUnscaledWidth(iRowWidth); 753 m_iMaxRowWidth = qMax(m_iMaxRowWidth, pNewRow->unscaledWidth()); 754 } 764 iMaxWidth = qMax(iMaxWidth, iX); 765 iY += iRowHeight; 766 if (i < layout.m_rows.size() - 1) 767 iY += m_iYSpacing; 768 } 769 m_pContainerWidget->setNewMinimumSize(QSize(iMaxWidth + m_iRightMargin, iY + m_iBottomMargin)); 755 770 } 756 771 … … 771 786 fMultiplier = fMultiplierY; 772 787 773 int y = 0;774 int totalHeight = 0;775 int totalWidth = 0;776 for (int i = 0; i <m_rows.size(); ++i)777 { 778 UISoftKeyboardRow *pRow = m_rows[i];779 if (!pRow)780 continue;781 if(m_fKeepAspectRatio)782 {783 pRow->setGeometry(0, y, fMultiplier * pRow->unscaledWidth(), fMultiplier * pRow->unscaledHeight());784 pRow->setVisible(true);785 y += fMultiplier * pRow->unscaledHeight();786 totalWidth += fMultiplier * pRow->unscaledWidth();787 totalHeight += fMultiplier * pRow->unscaledHeight();788 }789 else790 {791 pRow->setGeometry(0, y, fMultiplierX * pRow->unscaledWidth(), fMultiplierY * pRow->unscaledHeight());792 pRow->setVisible(true);793 y += fMultiplierY * pRow->unscaledHeight();794 totalWidth += fMultiplierX * pRow->unscaledWidth();795 totalHeight += fMultiplierY * pRow->unscaledHeight();796 }797 pRow->updateLayout();788 // int y = 0; 789 // int totalHeight = 0; 790 // int totalWidth = 0; 791 //for (int i = 0; i < layout.m_rows.size(); ++i) 792 { 793 // UISoftKeyboardRow *pRow = m_rows[i]; 794 // if (!pRow) 795 // continue; 796 // if(m_fKeepAspectRatio) 797 // { 798 // pRow->setGeometry(0, y, fMultiplier * pRow->unscaledWidth(), fMultiplier * pRow->unscaledHeight()); 799 // pRow->setVisible(true); 800 // y += fMultiplier * pRow->unscaledHeight(); 801 // totalWidth += fMultiplier * pRow->unscaledWidth(); 802 // totalHeight += fMultiplier * pRow->unscaledHeight(); 803 // } 804 // else 805 // { 806 // pRow->setGeometry(0, y, fMultiplierX * pRow->unscaledWidth(), fMultiplierY * pRow->unscaledHeight()); 807 // pRow->setVisible(true); 808 // y += fMultiplierY * pRow->unscaledHeight(); 809 // totalWidth += fMultiplierX * pRow->unscaledWidth(); 810 // totalHeight += fMultiplierY * pRow->unscaledHeight(); 811 // } 812 // pRow->updateLayout(); 798 813 } 799 814 } -
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h
r78682 r78812 37 37 class UISession; 38 38 class UISoftKeyboardKey; 39 class UISoftKeyboardRow;40 39 class QHBoxLayout; 41 40 class QVBoxLayout; 41 class UISoftKeyboardWidget; 42 42 class UIToolBar; 43 43 44 44 45 class UISoftKeyboard : public QIWithRetranslateUI<Q Widget>45 class UISoftKeyboard : public QIWithRetranslateUI<QMainWindow> 46 46 { 47 47 Q_OBJECT; … … 49 49 public: 50 50 51 UISoftKeyboard( EmbedTo enmEmbedding,QWidget *pParent, UISession *pSession,52 QString strMachineName = QString(), bool fShowToolbar = false);51 UISoftKeyboard(QWidget *pParent, UISession *pSession, 52 QString strMachineName = QString()); 53 53 ~UISoftKeyboard(); 54 54 … … 77 77 UISession *m_pSession; 78 78 QHBoxLayout *m_pMainLayout; 79 QWidget *m_pContainerWidget; 80 UIToolBar *m_pToolBar; 81 const bool m_fShowToolbar; 79 UISoftKeyboardWidget *m_pContainerWidget; 82 80 QString m_strMachineName; 83 QVector<UISoftKeyboardRow*> m_rows;84 81 int m_iTotalRowHeight; 85 82 int m_iMaxRowWidth; 86 83 QVector<UISoftKeyboardKey*> m_pressedModifiers; 84 QVector<QVector<UISoftKeyboardKey*> > m_keys; 87 85 bool m_fKeepAspectRatio; 86 87 int m_iXSpacing; 88 int m_iYSpacing; 89 int m_iLeftMargin; 90 int m_iTopMargin; 91 int m_iRightMargin; 92 int m_iBottomMargin; 88 93 }; 89 94 -
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboardDialog.cpp
r78680 r78812 35 35 36 36 /********************************************************************************************************************************* 37 * Class UISoftKeyboardDialogFactory implementation. *38 *********************************************************************************************************************************/39 40 UISoftKeyboardDialogFactory::UISoftKeyboardDialogFactory(UISession *pSession /* = 0 */, UIActionPool *pActionPool /* = 0 */,41 const QString &strMachineName /* = QString() */)42 : m_pSession(pSession)43 , m_pActionPool(pActionPool)44 , m_strMachineName(strMachineName)45 {46 }47 48 void UISoftKeyboardDialogFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget)49 {50 pDialog = new UISoftKeyboardDialog(pCenterWidget, m_pSession, m_pActionPool, m_strMachineName);51 }52 53 54 /*********************************************************************************************************************************55 37 * Class UISoftKeyboardDialog implementation. * 56 38 *********************************************************************************************************************************/ 57 39 58 UISoftKeyboardDialog::UISoftKeyboardDialog(QWidget *p CenterWidget,40 UISoftKeyboardDialog::UISoftKeyboardDialog(QWidget *pParent, 59 41 UISession *pSession, 60 UIActionPool *pActionPool,61 42 const QString &strMachineName /* = QString() */) 62 : Q IWithRetranslateUI<QIManagerDialog>(pCenterWidget)43 : QMainWindow(pParent) 63 44 , m_pSession(pSession) 64 , m_pActionPool(pActionPool)65 45 , m_strMachineName(strMachineName) 66 46 { … … 72 52 setWindowTitle(tr("%1 - Guest Control").arg(m_strMachineName)); 73 53 /* Translate buttons: */ 74 button(ButtonType_Close)->setText(tr("Close"));54 //button(ButtonType_Close)->setText(tr("Close")); 75 55 } 76 56 … … 84 64 { 85 65 /* Create widget: */ 86 UISoftKeyboard *pSoftKeyboard = new UISoftKeyboard(EmbedTo_Dialog, 0, m_pSession, "");66 //UISoftKeyboard *pSoftKeyboard = new UISoftKeyboard(EmbedTo_Dialog, 0, m_pSession, ""); 87 67 88 if (pSoftKeyboard)68 //if (pSoftKeyboard) 89 69 { 90 70 /* Configure widget: */ 91 setWidget(pSoftKeyboard);71 //setWidget(pSoftKeyboard); 92 72 //setWidgetMenu(pWidget->menu()); 93 73 #ifdef VBOX_WS_MAC … … 95 75 #endif 96 76 /* Add into layout: */ 97 centralWidget()->layout()->addWidget(pSoftKeyboard);77 //centralWidget()->layout()->addWidget(pSoftKeyboard); 98 78 } 99 79 } … … 107 87 void UISoftKeyboardDialog::loadSettings() 108 88 { 109 const QRect desktopRect = gpDesktop->availableGeometry(this);110 int iDefaultWidth = desktopRect.width() / 2;111 int iDefaultHeight = 0.5 * iDefaultWidth;89 // const QRect desktopRect = gpDesktop->availableGeometry(this); 90 // int iDefaultWidth = desktopRect.width() / 2; 91 // int iDefaultHeight = 0.5 * iDefaultWidth; 112 92 113 QRect defaultGeometry(0, 0, iDefaultWidth, iDefaultHeight);114 if (centerWidget())115 defaultGeometry.moveCenter(centerWidget()->geometry().center());93 // QRect defaultGeometry(0, 0, iDefaultWidth, iDefaultHeight); 94 // if (centerWidget()) 95 // defaultGeometry.moveCenter(centerWidget()->geometry().center()); 116 96 117 / * Load geometry from extradata: */118 QRect geometry = gEDataManager->softKeyboardDialogGeometry(this, defaultGeometry);97 // /* Load geometry from extradata: */ 98 // QRect geometry = gEDataManager->softKeyboardDialogGeometry(this, defaultGeometry); 119 99 120 / * Restore geometry: */121 LogRel2(("GUI: UISoftKeyboardDialog: Restoring geometry to: Origin=%dx%d, Size=%dx%d\n",122 geometry.x(), geometry.y(), geometry.width(), geometry.height()));123 setDialogGeometry(geometry);100 // /* Restore geometry: */ 101 // LogRel2(("GUI: UISoftKeyboardDialog: Restoring geometry to: Origin=%dx%d, Size=%dx%d\n", 102 // geometry.x(), geometry.y(), geometry.width(), geometry.height())); 103 // setDialogGeometry(geometry); 124 104 } 125 105 126 106 void UISoftKeyboardDialog::saveSettings() const 127 107 { 128 /* Save window geometry to extradata: */129 const QRect saveGeometry = geometry();130 #ifdef VBOX_WS_MAC131 /* darwinIsWindowMaximized expects a non-const QWidget*. thus const_cast: */132 QWidget *pw = const_cast<QWidget*>(qobject_cast<const QWidget*>(this));133 gEDataManager->setSoftKeyboardDialogGeometry(saveGeometry, ::darwinIsWindowMaximized(pw));134 #else /* !VBOX_WS_MAC */135 gEDataManager->setSoftKeyboardDialogGeometry(saveGeometry, isMaximized());136 #endif /* !VBOX_WS_MAC */137 LogRel2(("GUI: Soft Keyboard Dialog: Geometry saved as: Origin=%dx%d, Size=%dx%d\n",138 saveGeometry.x(), saveGeometry.y(), saveGeometry.width(), saveGeometry.height()));108 // /* Save window geometry to extradata: */ 109 // const QRect saveGeometry = geometry(); 110 // #ifdef VBOX_WS_MAC 111 // /* darwinIsWindowMaximized expects a non-const QWidget*. thus const_cast: */ 112 // QWidget *pw = const_cast<QWidget*>(qobject_cast<const QWidget*>(this)); 113 // gEDataManager->setSoftKeyboardDialogGeometry(saveGeometry, ::darwinIsWindowMaximized(pw)); 114 // #else /* !VBOX_WS_MAC */ 115 // gEDataManager->setSoftKeyboardDialogGeometry(saveGeometry, isMaximized()); 116 // #endif /* !VBOX_WS_MAC */ 117 // LogRel2(("GUI: Soft Keyboard Dialog: Geometry saved as: Origin=%dx%d, Size=%dx%d\n", 118 // saveGeometry.x(), saveGeometry.y(), saveGeometry.width(), saveGeometry.height())); 139 119 } 140 120 … … 144 124 } 145 125 146 void UISoftKeyboardDialog::sltSetCloseButtonShortCut(QKeySequence shortcut)126 void UISoftKeyboardDialog::sltSetCloseButtonShortCut(QKeySequence ) 147 127 { 148 if (button(ButtonType_Close))149 button(ButtonType_Close)->setShortcut(shortcut);128 // if (button(ButtonType_Close)) 129 // button(ButtonType_Close)->setShortcut(shortcut); 150 130 } -
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboardDialog.h
r78635 r78812 23 23 24 24 /* Qt includes: */ 25 #include <QMainWindow> 25 26 #include <QString> 26 27 /* GUI includes: */28 #include "QIManagerDialog.h"29 #include "QIWithRetranslateUI.h"30 27 31 28 /* COM includes: */ … … 39 36 class CGuest; 40 37 41 /** QIManagerDialogFactory extension used as a factory for the Guest Control dialog. */42 class UISoftKeyboardDialogFactory : public QIManagerDialogFactory43 {44 public:45 38 46 UISoftKeyboardDialogFactory(UISession *pSession = 0,UIActionPool *pActionPool = 0, const QString &strMachineName = QString()); 47 48 protected: 49 50 /** Creates derived @a pDialog instance. 51 * @param pCenterWidget Passes the widget to center wrt. pCenterWidget. */ 52 virtual void create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) /* override */; 53 54 UISession *m_pSession; 55 UIActionPool *m_pActionPool; 56 QString m_strMachineName; 57 }; 58 59 60 /** QIManagerDialog extension providing GUI with the dialog displaying guest control releated logs. */ 61 class UISoftKeyboardDialog : public QIWithRetranslateUI<QIManagerDialog> 39 class UISoftKeyboardDialog : public QMainWindow 62 40 { 63 41 Q_OBJECT; … … 68 46 * @param pCenterWidget Passes the widget reference to center according to. 69 47 * @param pActionPool Passes the action-pool reference. */ 70 UISoftKeyboardDialog(QWidget *p CenterWidget, UISession *pSession, UIActionPool *pActionPool, const QString &strMachineName = QString());48 UISoftKeyboardDialog(QWidget *pParent, UISession *pSession, const QString &strMachineName = QString()); 71 49 72 50 protected: -
trunk/src/VBox/Frontends/VirtualBox/xml/102_iso.xml
r78682 r78812 1 1 <?xml version="1.0"?> 2 <layout> 2 3 <layout defaultHeight="50" defaultWidth="50"> 3 4 <row> 4 <height>40</height> 5 <key> 6 <width>50</width> 7 <label>Esc</label> 5 <key> 6 <keycap>Esc</keycap> 8 7 <position>110</position> 9 8 <scancode>0x01</scancode> 10 9 </key> 11 <space> 12 <width>20</width> 13 </space> 14 <key> 15 <width>50</width> 16 <label>F1</label> 10 <space></space> 11 <key> 12 <keycap>F1</keycap> 17 13 <position>112</position> 18 14 <scancode>0x3b</scancode> 19 15 </key> 20 16 <key> 21 <width>50</width> 22 <label>F2</label> 17 <keycap>F2</keycap> 23 18 <position>113</position> 24 19 <scancode>0x3c</scancode> 25 20 </key> 26 21 <key> 27 <width>50</width> 28 <label>F3</label> 22 <keycap>F3</keycap> 29 23 <position>114</position> 30 24 <scancode>0x3d</scancode> 31 25 </key> 32 <space> 33 <width>20</width> 34 </space> 35 <key> 36 <width>50</width> 37 <label>F4</label> 26 <key> 27 <keycap>F4</keycap> 38 28 <position>115</position> 39 29 <scancode>0x3e</scancode> 40 30 </key> 41 <key> 42 <width>50</width> 43 <label>F5</label> 31 <space> 32 <width>25</width> 33 </space> 34 <key> 35 <keycap>F5</keycap> 44 36 <position>116</position> 45 37 <scancode>0x3f</scancode> 46 38 </key> 47 39 <key> 48 <width>50</width> 49 <label>F6</label> 40 <keycap>F6</keycap> 50 41 <position>117</position> 51 42 <scancode>0x40</scancode> 52 43 </key> 53 <space> 54 <width>20</width> 55 </space> 56 <key> 57 <width>50</width> 58 <label>F7</label> 44 <key> 45 <keycap>F7</keycap> 59 46 <position>188</position> 60 47 <scancode>0x41</scancode> 61 48 </key> 62 49 <key> 63 <width>50</width> 64 <label>F8</label> 50 <keycap>F8</keycap> 65 51 <position>119</position> 66 52 <scancode>0x42</scancode> 67 53 </key> 68 <key> 69 <width>50</width> 70 <label>F9</label> 54 <space> 55 <width>25</width> 56 </space> 57 <key> 58 <keycap>F9</keycap> 71 59 <position>120</position> 72 60 <scancode>0x43</scancode> 73 61 </key> 74 <space> 75 <width>20</width> 76 </space> 77 <key> 78 <width>50</width> 79 <label>F10</label> 62 <key> 63 <keycap>F10</keycap> 80 64 <position>121</position> 81 65 <scancode>0x44</scancode> 82 66 </key> 83 67 <key> 84 <width>50</width> 85 <label>F11</label> 68 <keycap>F11</keycap> 86 69 <position>122</position> 87 70 <scancode>0x57</scancode> 88 71 </key> 89 72 <key> 90 <width>50</width> 91 <label>F12</label> 73 <keycap>F12</keycap> 92 74 <position>123</position> 93 75 <scancode>0x58</scancode> 94 76 </key> 77 <space> 78 <width>25</width> 79 </space> 80 <key> 81 <keycap>PrtScn</keycap> 82 <position>121</position> 83 <scancode></scancode> 84 </key> 85 <key> 86 <keycap>ScrollLock</keycap> 87 <position>122</position> 88 <scancode>0x46</scancode> 89 </key> 90 <key> 91 <keycap>Pause</keycap> 92 <position>123</position> 93 <scancode></scancode> 94 </key> 95 95 </row> 96 96 <row> 97 <height>40</height> 98 <key> 99 <width>50</width> 100 <label>~</label> 101 <label>`</label> 97 <key> 98 <keycap>~</keycap> 99 <keycap>`</keycap> 102 100 <position>1</position> 103 101 <scancode>0x29</scancode> 104 102 </key> 105 103 <key> 106 <width>50</width> 107 <label>!</label> 108 <label>1</label> 104 <keycap>!</keycap> 105 <keycap>1</keycap> 109 106 <position>2</position> 110 107 <scancode>0x02</scancode> 111 108 </key> 112 109 <key> 113 <width>50</width> 114 <label>@</label> 115 <label>2</label> 110 <keycap>@</keycap> 111 <keycap>2</keycap> 116 112 <position>3</position> 117 113 <scancode>0x03</scancode> 118 114 </key> 119 115 <key> 120 <width>50</width> 121 <label>#</label> 122 <label>3</label> 116 <keycap>#</keycap> 117 <keycap>3</keycap> 123 118 <position>4</position> 124 119 <scancode>0x04</scancode> 125 120 </key> 126 121 <key> 127 <width>50</width> 128 <label>$</label> 129 <label>4</label> 122 <keycap>$</keycap> 123 <keycap>4</keycap> 130 124 <position>5</position> 131 125 <scancode>0x05</scancode> 132 126 </key> 133 127 <key> 134 <width>50</width> 135 <label>%</label> 136 <label>5</label> 128 <keycap>%</keycap> 129 <keycap>5</keycap> 137 130 <position>6</position> 138 131 <scancode>0x06</scancode> 139 132 </key> 140 133 <key> 141 <width>50</width> 142 <label>^</label> 143 <label>6</label> 134 <keycap>^</keycap> 135 <keycap>6</keycap> 144 136 <position>7</position> 145 137 <scancode>0x07</scancode> 146 138 </key> 147 139 <key> 148 <width>50</width> 149 <label>&</label> 150 <label>7</label> 140 <keycap>&</keycap> 141 <keycap>7</keycap> 151 142 <position>8</position> 152 143 <scancode>0x08</scancode> 153 144 </key> 154 145 <key> 155 <width>50</width> 156 <label>*</label> 157 <label>8</label> 146 <keycap>*</keycap> 147 <keycap>8</keycap> 158 148 <position>9</position> 159 149 <scancode>0x09</scancode> 160 150 </key> 161 151 <key> 162 <width>50</width> 163 <label>(</label> 164 <label>9</label> 152 <keycap>(</keycap> 153 <keycap>9</keycap> 165 154 <position>10</position> 166 155 <scancode>0x0a</scancode> 167 156 </key> 168 157 <key> 169 <width>50</width> 170 <label>)</label> 171 <label>0</label> 158 <keycap>)</keycap> 159 <keycap>0</keycap> 172 160 <position>11</position> 173 161 <scancode>0x0b</scancode> 174 162 </key> 175 163 <key> 176 <width>50</width> 177 <label>_</label> 178 <label>-</label> 164 <keycap>_</keycap> 165 <keycap>-</keycap> 179 166 <position>12</position> 180 167 <scancode>0x0c</scancode> 181 168 </key> 182 169 <key> 183 <width>50</width> 184 <label>+</label> 185 <label>=</label> 170 <keycap>+</keycap> 171 <keycap>=</keycap> 186 172 <position>13</position> 187 173 <scancode>0x0d</scancode> 188 174 </key> 189 175 <key> 190 <width> 80</width>191 < label>Backspace</label>176 <width>110</width> 177 <keycap>Backspace</keycap> 192 178 <position>14</position> 193 179 <scancode>0x0e</scancode> 194 </key>195 </row>196 <row>197 <height>40</height>198 <key>199 <width>70</width>200 <label>Tab</label>201 <position>16</position>202 <scancode>0x0f</scancode>203 </key>204 <key>205 <width>50</width>206 <label>Q</label>207 <position>17</position>208 <scancode>0x10</scancode>209 </key>210 <key>211 <width>50</width>212 <label>W</label>213 <position>18</position>214 <scancode>0x11</scancode>215 </key>216 <key>217 <width>50</width>218 <label>E</label>219 <position>19</position>220 <scancode>0x12</scancode>221 </key>222 <key>223 <width>50</width>224 <label>R</label>225 <position>20</position>226 <scancode>0x13</scancode>227 </key>228 <key>229 <width>50</width>230 <label>T</label>231 <position>21</position>232 <scancode>0x14</scancode>233 </key>234 <key>235 <width>50</width>236 <label>Y</label>237 <position>22</position>238 <scancode>0x15</scancode>239 </key>240 <key>241 <width>50</width>242 <label>U</label>243 <position>23</position>244 <scancode>0x16</scancode>245 </key>246 <key>247 <width>50</width>248 <label>I</label>249 <position>24</position>250 <scancode>0x17</scancode>251 </key>252 <key>253 <width>50</width>254 <label>O</label>255 <position>25</position>256 <scancode>0x18</scancode>257 </key>258 <key>259 <width>50</width>260 <label>P</label>261 <position>26</position>262 <scancode>0x19</scancode>263 </key>264 <key>265 <width>50</width>266 <label>{</label>267 <label>[</label>268 <position>27</position>269 <scancode>0x1a</scancode>270 </key>271 <key>272 <width>50</width>273 <label>}</label>274 <label>]</label>275 <position>28</position>276 <scancode>0x1b</scancode>277 </key>278 <key>279 <width>60</width>280 <label>|</label>281 <label>\</label>282 <position>29</position>283 <scancode>0x2b</scancode>284 180 </key> 285 181 </row> 286 182 287 183 <row> 288 <height>40</height> 289 <key> 290 <width>70</width> 291 <label>CapsLock</label> 292 <type>toggleable</type> 293 <position>30</position> 294 <scancode>0x3a</scancode> 295 </key> 296 <key> 297 <width>50</width> 298 <label>A</label> 299 <position>31</position> 300 <scancode>0x1e</scancode> 301 </key> 302 <key> 303 <width>50</width> 304 <label>S</label> 305 <position>32</position> 306 <scancode>0x1f</scancode> 307 </key> 308 <key> 309 <width>50</width> 310 <label>D</label> 311 <position>33</position> 312 <scancode>0x20</scancode> 313 </key> 314 <key> 315 <width>50</width> 316 <label>F</label> 317 <position>34</position> 318 <scancode>0x21</scancode> 319 </key> 320 <key> 321 <width>50</width> 322 <label>G</label> 323 <position>35</position> 324 <scancode>0x22</scancode> 325 </key> 326 <key> 327 <width>50</width> 328 <label>H</label> 329 <position>36</position> 330 <scancode>0x23</scancode> 331 </key> 332 <key> 333 <width>50</width> 334 <label>J</label> 335 <position>37</position> 336 <scancode>0x24</scancode> 337 </key> 338 <key> 339 <width>50</width> 340 <label>K</label> 341 <position>38</position> 342 <scancode>0x25</scancode> 343 </key> 344 <key> 345 <width>50</width> 346 <label>L</label> 347 <position>39</position> 348 <scancode>0x26</scancode> 349 </key> 350 <key> 351 <width>50</width> 352 <label>:</label> 353 <label>;</label> 354 <position>40</position> 355 <scancode>0x27</scancode> 356 </key> 357 <key> 358 <width>50</width> 359 <label>"</label> 360 <label>'</label> 361 <position>41</position> 362 <scancode>0x28</scancode> 363 </key> 364 <key> 365 <width>110</width> 366 <label>Enter</label> 367 <position>43</position> 368 <scancode>0x1c</scancode> 184 <key> 185 <width>75</width> 186 <keycap>Tab</keycap> 187 <position>16</position> 188 <scancode>0x0f</scancode> 189 </key> 190 <key> 191 <keycap>Q</keycap> 192 <position>17</position> 193 <scancode>0x10</scancode> 194 </key> 195 <key> 196 <keycap>W</keycap> 197 <position>18</position> 198 <scancode>0x11</scancode> 199 </key> 200 <key> 201 <keycap>E</keycap> 202 <position>19</position> 203 <scancode>0x12</scancode> 204 </key> 205 <key> 206 <keycap>R</keycap> 207 <position>20</position> 208 <scancode>0x13</scancode> 209 </key> 210 <key> 211 <keycap>T</keycap> 212 <position>21</position> 213 <scancode>0x14</scancode> 214 </key> 215 <key> 216 <keycap>Y</keycap> 217 <position>22</position> 218 <scancode>0x15</scancode> 219 </key> 220 <key> 221 <keycap>U</keycap> 222 <position>23</position> 223 <scancode>0x16</scancode> 224 </key> 225 <key> 226 <keycap>I</keycap> 227 <position>24</position> 228 <scancode>0x17</scancode> 229 </key> 230 <key> 231 <keycap>O</keycap> 232 <position>25</position> 233 <scancode>0x18</scancode> 234 </key> 235 <key> 236 <keycap>P</keycap> 237 <position>26</position> 238 <scancode>0x19</scancode> 239 </key> 240 <key> 241 <keycap>{</keycap> 242 <keycap>[</keycap> 243 <position>27</position> 244 <scancode>0x1a</scancode> 245 </key> 246 <key> 247 <keycap>}</keycap> 248 <keycap>]</keycap> 249 <position>28</position> 250 <scancode>0x1b</scancode> 251 </key> 252 <key> 253 <width>85</width> 254 <height>100</height> 255 <keycap>Enter</keycap> 256 <position>29</position> 257 <scancode>0x2b</scancode> 258 <cutout> 259 <width>25</width> 260 <height>50</height> 261 <corner>bottomLeft</corner> 262 </cutout> 369 263 </key> 370 264 </row> 371 <row>372 <height>40</height>373 <key>374 <width>115</width>375 <label>Shift</label>376 <type>modifier</type>377 <position>44</position>378 <scancode>0x2a</scancode>379 </key>380 <key>381 <width>50</width>382 <label>Z</label>383 <position>46</position>384 <scancode>0x2c</scancode>385 </key>386 <key>387 <width>50</width>388 <label>X</label>389 <position>47</position>390 <scancode>0x2d</scancode>391 </key>392 <key>393 <width>50</width>394 <label>C</label>395 <position>48</position>396 <scancode>0x2e</scancode>397 </key>398 <key>399 <width>50</width>400 <label>V</label>401 <position>49</position>402 <scancode>0x2f</scancode>403 </key>404 <key>405 <width>50</width>406 <label>B</label>407 <position>50</position>408 <scancode>0x30</scancode>409 </key>410 <key>411 <width>50</width>412 <label>N</label>413 <position>51</position>414 <scancode>0x31</scancode>415 </key>416 <key>417 <width>50</width>418 <label>M</label>419 <position>52</position>420 <scancode>0x32</scancode>421 </key>422 <key>423 <width>50</width>424 <label><</label>425 <label>,</label>426 <position>53</position>427 <scancode>0x33</scancode>428 </key>429 <key>430 <width>50</width>431 <label>></label>432 <label>.</label>433 <position>54</position>434 <scancode>0x34</scancode>435 </key>436 <key>437 <width>50</width>438 <label>?</label>439 <label>/</label>440 <position>55</position>441 <scancode>0x35</scancode>442 </key>443 <key>444 <width>115</width>445 <label>Shift</label>446 <type>modifier</type>447 <position>57</position>448 <scancode>0x36</scancode>449 </key>450 </row>451 452 <row>453 <height>40</height>454 <key>455 <width>90</width>456 <label>Ctrl</label>457 <type>modifier</type>458 <position>58</position>459 <scancode>0x1d</scancode>460 </key>461 <key>462 <width>50</width>463 <label>Win</label>464 <type>modifier</type>465 <scancodeprefix>0xe0</scancodeprefix>466 <scancode>0x5b</scancode>467 </key>468 <key>469 <width>70</width>470 <position>60</position>471 <label>Alt</label>472 <type>modifier</type>473 <scancode>0x38</scancode>474 </key>475 <key>476 <width>240</width>477 <position>61</position>478 <scancode>0x39</scancode>479 </key>480 <key>481 <width>70</width>482 <label>AltGr</label>483 <type>modifier</type>484 <scancodeprefix>0xe0</scancodeprefix>485 <scancode>0x38</scancode>486 </key>487 <key>488 <width>50</width>489 <label>Win</label>490 <type>modifier</type>491 <scancodeprefix>0xe0</scancodeprefix>492 <scancode>0x5c</scancode>493 </key>494 <key>495 <width>70</width>496 <label>Menu</label>497 <scancodeprefix>0xe0</scancodeprefix>498 <scancode>0x5d</scancode>499 </key>500 <key>501 <width>90</width>502 <label>Ctrl</label>503 <type>modifier</type>504 <scancodeprefix>0xe0</scancodeprefix>505 <scancode>0x1d</scancode>506 </key>507 508 </row>509 510 265 </layout> -
trunk/src/VBox/Frontends/VirtualBox/xml/us_layout.xml
r78680 r78812 284 284 </key> 285 285 </row> 286 287 286 <row> 288 287 <height>40</height>
Note:
See TracChangeset
for help on using the changeset viewer.