- Timestamp:
- May 22, 2019 5:32:20 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp
r78669 r78672 46 46 enum UIKeyType 47 47 { 48 UIKeyType_SingleState, 49 UIKeyType_DualState, 50 UIKeyType_TriState, 48 UIKeyType_Ordinary, 49 /** e.g. CapsLock. Can be only in UIKeyState_NotPressed, UIKeyState_Locked, */ 50 UIKeyType_Toggleable, 51 /** e.g. Shift Can be in all 3 states*/ 52 UIKeyType_Modifier, 51 53 UIKeyType_Max 52 54 }; … … 248 250 key.m_scanCodePrefix = 0; 249 251 key.m_iSpaceAfter = 0; 250 key.m_enmType = UIKeyType_ SingleState;252 key.m_enmType = UIKeyType_Ordinary; 251 253 252 254 while (m_xmlReader.readNextStartElement()) … … 280 282 { 281 283 QString strType = m_xmlReader.readElementText(); 282 if (strType == " tristate")283 key.m_enmType = UIKeyType_ TriState;284 else if (strType == " dualstate")285 key.m_enmType = UIKeyType_ DualState;284 if (strType == "modifier") 285 key.m_enmType = UIKeyType_Modifier; 286 else if (strType == "toggleable") 287 key.m_enmType = UIKeyType_Toggleable; 286 288 } 287 289 else … … 301 303 , m_scanCode(0) 302 304 , m_scanCodePrefix(0) 303 , m_enmType(UIKeyType_ SingleState)305 , m_enmType(UIKeyType_Ordinary) 304 306 , m_enmState(UIKeyState_NotPressed) 305 307 , m_fScaleMultiplier(1.f) … … 401 403 QToolButton::paintEvent(pEvent); 402 404 403 if (m_enmType == UIKeyType_SingleState) 404 return; 405 405 if (m_enmType == UIKeyType_Ordinary) 406 return; 406 407 407 408 QPainter painter(this); … … 427 428 void UISoftKeyboardKey::updateState(bool fPressed) 428 429 { 429 if (m_enmType == UIKeyType_ SingleState)430 return; 431 if (m_enmType == UIKeyType_ TriState)430 if (m_enmType == UIKeyType_Ordinary) 431 return; 432 if (m_enmType == UIKeyType_Modifier) 432 433 { 433 434 if (fPressed) … … 446 447 } 447 448 } 448 else if (m_enmType == UIKeyType_ DualState)449 else if (m_enmType == UIKeyType_Toggleable) 449 450 { 450 451 if (fPressed) … … 566 567 if (!pKey) 567 568 return; 568 if (pKey->type() != UIKeyType_SingleState)569 if (pKey->type() == UIKeyType_Modifier) 569 570 return; 570 571 … … 591 592 if (!pKey) 592 593 return; 593 594 if (pKey->type() != UIKeyType_SingleState)594 /* We only send the scan codes of Ordinary keys: */ 595 if (pKey->type() == UIKeyType_Modifier) 595 596 return; 596 597 … … 604 605 { 605 606 UISoftKeyboardKey *pModifier = m_pressedModifiers[i]; 606 if (pModifier->type() == UIKeyType_DualState)607 continue;608 607 if (pModifier->scanCodePrefix() != 0) 609 608 sequence << pModifier->scanCodePrefix(); … … 620 619 if (!pKey) 621 620 return; 622 if (pKey->type() == UIKeyType_SingleState)621 if (pKey->type() != UIKeyType_Modifier) 623 622 return; 624 623 if (pKey->state() == UIKeyState_NotPressed) -
trunk/src/VBox/Frontends/VirtualBox/xml/us_layout.xml
r78664 r78672 290 290 <width>70</width> 291 291 <label>CapsLock</label> 292 <type> dualstate</type>292 <type>toggleable</type> 293 293 <position>30</position> 294 294 <scancode>0x3a</scancode> … … 374 374 <width>115</width> 375 375 <label>Shift</label> 376 <type> tristate</type>376 <type>modifier</type> 377 377 <position>44</position> 378 378 <scancode>0x2a</scancode> … … 444 444 <width>115</width> 445 445 <label>Shift</label> 446 <type> tristate</type>446 <type>modifier</type> 447 447 <position>57</position> 448 448 <scancode>0x36</scancode> … … 455 455 <width>90</width> 456 456 <label>Ctrl</label> 457 <type> tristate</type>457 <type>modifier</type> 458 458 <position>58</position> 459 459 <scancode>0x1d</scancode> … … 462 462 <width>50</width> 463 463 <label>Win</label> 464 <type> tristate</type>464 <type>modifier</type> 465 465 <scancodeprefix>0xe0</scancodeprefix> 466 466 <scancode>0x5b</scancode> … … 470 470 <position>60</position> 471 471 <label>Alt</label> 472 <type> tristate</type>472 <type>modifier</type> 473 473 <scancode>0x38</scancode> 474 474 </key> … … 481 481 <width>70</width> 482 482 <label>AltGr</label> 483 <type> tristate</type>483 <type>modifier</type> 484 484 <scancodeprefix>0xe0</scancodeprefix> 485 485 <scancode>0x38</scancode> … … 488 488 <width>50</width> 489 489 <label>Win</label> 490 <type> tristate</type>490 <type>modifier</type> 491 491 <scancodeprefix>0xe0</scancodeprefix> 492 492 <scancode>0x5c</scancode> … … 501 501 <width>90</width> 502 502 <label>Ctrl</label> 503 <type> tristate</type>503 <type>modifier</type> 504 504 <scancodeprefix>0xe0</scancodeprefix> 505 505 <scancode>0x1d</scancode>
Note:
See TracChangeset
for help on using the changeset viewer.