Changeset 25304 in vbox
- Timestamp:
- Dec 10, 2009 3:21:10 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r25211 r25304 701 701 , mMouseAbsolute (false) 702 702 , mMouseIntegration (true) 703 , m_iLastMouseWheelDelta(0) 703 704 , mDisableAutoCapture (false) 704 705 , mIsHostkeyPressed (false) … … 1767 1768 { 1768 1769 QMouseEvent *me = (QMouseEvent *) e; 1770 m_iLastMouseWheelDelta = 0; 1769 1771 if (mouseEvent (me->type(), me->pos(), me->globalPos(), 1770 1772 me->buttons(), me->modifiers(), … … 1776 1778 { 1777 1779 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 } 1778 1792 if (mouseEvent (we->type(), we->pos(), we->globalPos(), 1779 1793 #ifdef QT_MAC_USE_COCOA … … 1788 1802 #endif /* QT_MAC_USE_COCOA */ 1789 1803 we->modifiers(), 1790 we->delta(), we->orientation()))1804 iDelta, we->orientation())) 1791 1805 return true; /* stop further event handling */ 1792 1806 break; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.h
r25171 r25304 278 278 QPoint mLastPos; 279 279 QPoint mCapturedPos; 280 int m_iLastMouseWheelDelta; 280 281 281 282 bool mDisableAutoCapture : 1;
Note:
See TracChangeset
for help on using the changeset viewer.