<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-06-17 12:43 GMT+02:00 Elvis Stansvik <span dir="ltr"><<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi all,<br><br></div>From what I've read, vtkInteractorStyleUser is still the canonical way to do completely custom interaction behavior from Python, by observing the events of the interactor.<br><br></div>But running this minimal test case:<br><br>from vtk import vtkRenderWindow<br>from vtk import vtkRenderWindowInteractor<br>from vtk import vtkInteractorStyleUser<br>from vtk import vtkCommand<br><br>def onLeftButtonPressEvent(sender, event):<br> print('left button press')<br><br>def onMouseWheelForwardEvent(sender, event):<br> print('wheel forward')<br><br>interactorStyle = vtkInteractorStyleUser()<br><br>interactorStyle.AddObserver(<br> vtkCommand.LeftButtonPressEvent,<br> onLeftButtonPressEvent)<br><br>interactorStyle.AddObserver(<br> vtkCommand.MouseWheelForwardEvent,<br> onMouseWheelForwardEvent)<br><br>renderWindow = vtkRenderWindow()<br><br>interactor = vtkRenderWindowInteractor()<br>interactor.SetRenderWindow(renderWindow)<br>interactor.SetInteractorStyle(interactorStyle)<br>interactor.Start()<br><br></div>It seems that wheel events are not supported by vtkInteractorStyleUser? Scrolling the wheel forwards prints nothing, while pressing the left mouse button prints "left button press" as expected.<br></div></div></div></div></blockquote><div><br></div><div>I'm starting to think that this is simply an accidental omission in vtkInteractorStyleUser. Would you accept a patch to add support for MouseWheelForwardEvent and MouseWheelBackwardEvent?<br><br></div><div>Elvis<br><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><br></div>What should I do if I want to provide completely custom interaction from Python, and still be able to handle wheel events?<br><br></div>Thanks in advance,<br></div>Elvis<br><br></div>
</blockquote></div><br></div></div>