Gui: implement SoMouseWheelEvent

and sythesize it instead of fake buttons 4 and 5
This commit is contained in:
DeepSOIC
2020-08-09 23:38:39 +03:00
committed by wwmayer
parent cd7a6a237a
commit 1cb10c078f
6 changed files with 106 additions and 9 deletions

View File

@@ -41,6 +41,7 @@
#include "Application.h"
#include "Document.h"
#include "NavigationStyle.h"
#include "SoMouseWheelEvent.h"
#include "SoFCSelectionAction.h"
#include "SoFCOffscreenRenderer.h"
#include "SoFCVectorizeSVGAction.h"
@@ -1992,6 +1993,10 @@ void View3DInventorPy::eventCallback(void * ud, SoEventCallback * n)
dict.setItem("Button", Py::String(button));
}
if (e->isOfType(SoMouseWheelEvent::getClassTypeId())){
const SoMouseWheelEvent* mwe = static_cast<const SoMouseWheelEvent*>(e);
dict.setItem("Delta", Py::Long(mwe->getDelta()));
}
if (e->isOfType(SoSpaceballButtonEvent::getClassTypeId())) {
const SoSpaceballButtonEvent* sbe = static_cast<const SoSpaceballButtonEvent*>(e);
std::string button;