VirtualBox

Changeset 79669 in vbox


Ignore:
Timestamp:
Jul 10, 2019 10:46:06 AM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6143. Handling multi part scan code prefixes correctly

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp

    r79654 r79669  
    325325    LONG scanCode() const;
    326326
    327     void setScanCodePrefix(LONG scanCode);
    328     LONG scanCodePrefix() const;
     327    void addScanCodePrefix(LONG scanCode);
     328    const QVector<LONG> &scanCodePrefix() const;
    329329
    330330    void setSpaceWidthAfter(int iSpace);
     
    378378    int        m_iSpaceWidthAfter;
    379379    LONG       m_scanCode;
    380     LONG      m_scanCodePrefix;
     380    QVector<LONG> m_scanCodePrefix;
    381381
    382382    /** @name Cutouts are used to create non-rectangle keys polygons.
     
    13961396    , m_iSpaceWidthAfter(0)
    13971397    , m_scanCode(0)
    1398     , m_scanCodePrefix(0)
    13991398    , m_iCutoutWidth(0)
    14001399    , m_iCutoutHeight(0)
     
    14491448}
    14501449
    1451 void UISoftKeyboardKey::setScanCodePrefix(LONG scanCodePrefix)
    1452 {
    1453     m_scanCodePrefix = scanCodePrefix;
    1454 }
    1455 
    1456 LONG UISoftKeyboardKey::scanCodePrefix() const
     1450void UISoftKeyboardKey::addScanCodePrefix(LONG scanCodePrefix)
     1451{
     1452    m_scanCodePrefix << scanCodePrefix;
     1453}
     1454
     1455const QVector<LONG> &UISoftKeyboardKey::scanCodePrefix() const
    14571456{
    14581457    return m_scanCodePrefix;
     
    24282427
    24292428    QVector<LONG> sequence;
    2430     if (pKey->scanCodePrefix() != 0)
     2429    if (!pKey->scanCodePrefix().isEmpty())
    24312430        sequence <<  pKey->scanCodePrefix();
    24322431    sequence << (pKey->scanCode() | 0x80);
     
    24362435    {
    24372436        UISoftKeyboardKey *pModifier = m_pressedModifiers[i];
    2438         if (pModifier->scanCodePrefix() != 0)
     2437        if (!pModifier->scanCodePrefix().isEmpty())
    24392438            sequence << pModifier->scanCodePrefix();
    24402439        sequence << (pModifier->scanCode() | 0x80);
     
    24592458    {
    24602459        UISoftKeyboardKey *pModifier = m_pressedModifiers[i];
    2461         if (pModifier->scanCodePrefix() != 0)
     2460        if (!pModifier->scanCodePrefix().isEmpty())
    24622461            sequence << pModifier->scanCodePrefix();
    24632462        sequence << pModifier->scanCode();
    24642463    }
    24652464
    2466     if (pKey->scanCodePrefix() != 0)
     2465    if (!pKey->scanCodePrefix().isEmpty())
    24672466        sequence << pKey->scanCodePrefix();
    24682467    sequence << pKey->scanCode();
     
    29152914        {
    29162915            QString strCode = m_xmlReader.readElementText();
    2917             bool fOk = false;
    2918             key.setScanCodePrefix(strCode.toInt(&fOk, 16));
     2916            QStringList strList;
     2917            strList << strCode.split('-', QString::SkipEmptyParts);
     2918            foreach (const QString &strPrefix, strList)
     2919            {
     2920                bool fOk = false;
     2921                LONG iCode = strPrefix.toInt(&fOk, 16);
     2922                if (fOk)
     2923                    key.addScanCodePrefix(iCode);
     2924            }
    29192925        }
    29202926        else if (m_xmlReader.name() == "cutout")
  • trunk/src/VBox/Frontends/VirtualBox/xml/103_iso.xml

    r79667 r79669  
    8282            <scancodeprefix>0xe1-0x1d</scancodeprefix>
    8383            <scancode>0x45</scancode>
     84            0xe1-0x1d-0x45-0xe1-0x9d-0xc5
    8485        </key>
    8586    </row>
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette