0000607: Holding down middle mouse button (wheel) will zoom out without scrolling

This commit is contained in:
wmayer 2012-02-24 11:07:41 +01:00
parent 0435a36569
commit 614e0442d7
2 changed files with 9 additions and 2 deletions

View File

@ -715,8 +715,6 @@ void NavigationStyle::zoomByCursor(const SbVec2f & thispos, const SbVec2f & prev
void NavigationStyle::doZoom(SoCamera* camera, SbBool forward, const SbVec2f& pos) void NavigationStyle::doZoom(SoCamera* camera, SbBool forward, const SbVec2f& pos)
{ {
if (this->button3down)
return;
SbBool zoomAtCur = this->zoomAtCursor; SbBool zoomAtCur = this->zoomAtCursor;
if (zoomAtCur) { if (zoomAtCur) {
const SbViewportRegion & vp = viewer->getViewportRegion(); const SbViewportRegion & vp = viewer->getViewportRegion();

View File

@ -74,6 +74,7 @@
# include <Inventor/VRMLnodes/SoVRMLGroup.h> # include <Inventor/VRMLnodes/SoVRMLGroup.h>
# include <QEventLoop> # include <QEventLoop>
# include <QKeyEvent> # include <QKeyEvent>
# include <QWheelEvent>
# include <QMessageBox> # include <QMessageBox>
# include <QTimer> # include <QTimer>
# include <QStatusBar> # include <QStatusBar>
@ -1033,6 +1034,14 @@ void View3DInventorViewer::selectAll()
*/ */
void View3DInventorViewer::processEvent(QEvent * event) void View3DInventorViewer::processEvent(QEvent * event)
{ {
// Bug #0000607: Some mices also support horizontal scrolling which however might
// lead to some unwanted zooming when pressing the MMB for panning.
// Thus, we filter out horizontal scrolling.
if (event->type() == QEvent::Wheel) {
QWheelEvent* we = static_cast<QWheelEvent*>(event);
if (we->orientation() == Qt::Horizontal)
return;
}
if (event->type() == QEvent::KeyPress) { if (event->type() == QEvent::KeyPress) {
QKeyEvent* ke = static_cast<QKeyEvent*>(event); QKeyEvent* ke = static_cast<QKeyEvent*>(event);
if (ke->matches(QKeySequence::SelectAll)) { if (ke->matches(QKeySequence::SelectAll)) {