VirtualBox

Changeset 25304 in vbox


Ignore:
Timestamp:
Dec 10, 2009 3:21:10 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: Allow wheel event deltas which have smaller distances than 120.

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

Legend:

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

    r25211 r25304  
    701701    , mMouseAbsolute (false)
    702702    , mMouseIntegration (true)
     703    , m_iLastMouseWheelDelta(0)
    703704    , mDisableAutoCapture (false)
    704705    , mIsHostkeyPressed (false)
     
    17671768            {
    17681769                QMouseEvent *me = (QMouseEvent *) e;
     1770                m_iLastMouseWheelDelta = 0;
    17691771                if (mouseEvent (me->type(), me->pos(), me->globalPos(),
    17701772                                me->buttons(), me->modifiers(),
     
    17761778            {
    17771779                QWheelEvent *we = (QWheelEvent *) e;
     1780                /* There are pointing devices which send smaller values for the
     1781                 * delta than 120. Here we sum them up until we are greater
     1782                 * than 120. This allows to have finer control over the speed
     1783                 * acceleration & enables such devices to send a valid wheel
     1784                 * event to our guest mouse device at all. */
     1785                int iDelta = 0;
     1786                m_iLastMouseWheelDelta += we->delta();
     1787                if (qAbs(m_iLastMouseWheelDelta) >= 120)
     1788                {
     1789                    iDelta = m_iLastMouseWheelDelta;
     1790                    m_iLastMouseWheelDelta = m_iLastMouseWheelDelta % 120;
     1791                }
    17781792                if (mouseEvent (we->type(), we->pos(), we->globalPos(),
    17791793#ifdef QT_MAC_USE_COCOA
     
    17881802#endif /* QT_MAC_USE_COCOA */
    17891803                                we->modifiers(),
    1790                                 we->delta(), we->orientation()))
     1804                                iDelta, we->orientation()))
    17911805                    return true; /* stop further event handling */
    17921806                break;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.h

    r25171 r25304  
    278278    QPoint mLastPos;
    279279    QPoint mCapturedPos;
     280    int m_iLastMouseWheelDelta;
    280281
    281282    bool mDisableAutoCapture : 1;
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