VirtualBox

Changeset 35735 in vbox


Ignore:
Timestamp:
Jan 27, 2011 12:15:53 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: 5245: GUI support for complex host-key combinations: Host-key combination size limited to 3 keys.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.cpp

    r35734 r35735  
    243243
    244244
     245namespace UIHotKeyCombination
     246{
     247    int m_iMaxComboSize = 3;
     248}
     249
    245250QString UIHotKeyCombination::toReadableString(const QString &strKeyCombo)
    246251{
     
    266271{
    267272    QList<int> keyCodeList = toKeyCodeList(strKeyCombo);
     273    if (keyCodeList.size() > m_iMaxComboSize)
     274        return false;
    268275    for (int i = 0; i < keyCodeList.size(); ++i)
    269276        if (!UIHotKey::isValidKey(keyCodeList[i]))
     
    382389                    m_shownKeys.clear();
    383390
    384                 /* Remember pressed symbol: */
    385                 m_pressedKeys << pMsg->wParam;
    386                 m_shownKeys.insert(iKeyCode, UIHotKey::toString(iKeyCode));
    387 
    388                 /* Remember what we already started a sequence: */
    389                 m_fStartNewSequence = false;
     391                /* Check maximum combo size: */
     392                if (m_shownKeys.size() < UIHotKeyCombination::m_iMaxComboSize)
     393                {
     394                    /* Remember pressed symbol: */
     395                    m_pressedKeys << pMsg->wParam;
     396                    m_shownKeys.insert(iKeyCode, UIHotKey::toString(iKeyCode));
     397
     398                    /* Remember what we already started a sequence: */
     399                    m_fStartNewSequence = false;
     400                }
    390401            }
    391402            /* Key release: */
     
    438449                    m_shownKeys.clear();
    439450
    440                 /* Remember pressed symbol: */
    441                 m_pressedKeys << iKeySym;
    442                 m_shownKeys.insert(iKeySym, UIHotKey::toString(iKeySym));
    443 
    444                 /* Remember what we already started a sequence: */
    445                 m_fStartNewSequence = false;
     451                /* Check maximum combo size: */
     452                if (m_shownKeys.size() < UIHotKeyCombination::m_iMaxComboSize)
     453                {
     454                    /* Remember pressed symbol: */
     455                    m_pressedKeys << iKeySym;
     456                    m_shownKeys.insert(iKeySym, UIHotKey::toString(iKeySym));
     457
     458                    /* Remember what we already started a sequence: */
     459                    m_fStartNewSequence = false;
     460                }
    446461            }
    447462            /* Key release: */
     
    528543                        m_shownKeys.clear();
    529544
    530                     /* Remember pressed symbol: */
    531                     m_pressedKeys << iKeyCode;
    532                     m_shownKeys.insert(iKeyCode, UIHotKey::toString(iKeyCode));
    533 
    534                     /* Remember what we already started a sequence: */
    535                     m_fStartNewSequence = false;
     545                    /* Check maximum combo size: */
     546                    if (m_shownKeys.size() < UIHotKeyCombination::m_iMaxComboSize)
     547                    {
     548                        /* Remember pressed symbol: */
     549                        m_pressedKeys << iKeyCode;
     550                        m_shownKeys.insert(iKeyCode, UIHotKey::toString(iKeyCode));
     551
     552                        /* Remember what we already started a sequence: */
     553                        m_fStartNewSequence = false;
     554                    }
    536555                }
    537556            }
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