From ac4b6a4d91b075f6bc89a7eac244e03070a92dbf Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 31 Dec 2011 17:51:41 +0000 Subject: [PATCH] + implement alternative zooming for Inventor style + proper handling of space navigator events + fix bug when assigning user-defined shortcuts git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5369 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- src/Gui/Application.cpp | 3 ++- src/Gui/DlgKeyboardImp.cpp | 2 +- src/Gui/InventorNavigationStyle.cpp | 6 +++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index c8025328b..f4e108c6c 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -1437,7 +1437,8 @@ public: (int)event->type()); } try { - if (event->type() == Spaceball::ButtonEvent::ButtonEventType || Spaceball::MotionEvent::MotionEventType) + if (event->type() == Spaceball::ButtonEvent::ButtonEventType || + event->type() == Spaceball::MotionEvent::MotionEventType) return processSpaceballEvent(receiver, event); else return QApplication::notify(receiver, event); diff --git a/src/Gui/DlgKeyboardImp.cpp b/src/Gui/DlgKeyboardImp.cpp index fe947dbc1..0e0b3af4b 100644 --- a/src/Gui/DlgKeyboardImp.cpp +++ b/src/Gui/DlgKeyboardImp.cpp @@ -204,7 +204,7 @@ void DlgCustomKeyboardImp::on_buttonAssign_clicked() editShortcut->clear(); ParameterGrp::handle hGrp = WindowParameter::getDefaultParameter()->GetGroup("Shortcut"); - hGrp->SetASCII(name.constData(), accelLineEditShortcut->text().toAscii()); + hGrp->SetASCII(name.constData(), accelLineEditShortcut->text().toUtf8()); buttonAssign->setEnabled(false); buttonReset->setEnabled(true); } diff --git a/src/Gui/InventorNavigationStyle.cpp b/src/Gui/InventorNavigationStyle.cpp index 65db39aff..5c9afd6fc 100644 --- a/src/Gui/InventorNavigationStyle.cpp +++ b/src/Gui/InventorNavigationStyle.cpp @@ -226,6 +226,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) } } } + this->button2down = press; break; case SoMouseButtonEvent::BUTTON3: if (press) { @@ -306,10 +307,12 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) BUTTON1DOWN = 1 << 0, BUTTON3DOWN = 1 << 1, CTRLDOWN = 1 << 2, - SHIFTDOWN = 1 << 3 + SHIFTDOWN = 1 << 3, + BUTTON2DOWN = 1 << 4 }; unsigned int combo = (this->button1down ? BUTTON1DOWN : 0) | + (this->button2down ? BUTTON2DOWN : 0) | (this->button3down ? BUTTON3DOWN : 0) | (this->ctrldown ? CTRLDOWN : 0) | (this->shiftdown ? SHIFTDOWN : 0); @@ -339,6 +342,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) break; case BUTTON1DOWN|BUTTON3DOWN: case CTRLDOWN|BUTTON3DOWN: + case CTRLDOWN|SHIFTDOWN|BUTTON2DOWN: newmode = NavigationStyle::ZOOMING; break;