Thanks. That did the trick :-)<br><br><div class="gmail_quote">On Thu, Feb 10, 2011 at 11:46 AM, Clinton Stimpson <span dir="ltr"><<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Thursday, February 10, 2011 07:17:24 am imran khan wrote:<br>
> Hmmm.... that is weird as I can get mouse moves. Please see code below.<br>
><br>
> vtkEventQtSlotConnect * connections = vtkEventQtSlotConnect::New();<br>
><br>
> .. connections->Connect(interactorROI,<br>
> vtkCommand::MouseMoveEvent,<br>
> this,<br>
> SLOT(handleMouseMove()));<br>
><br>
> ..<br>
><br>
> // The slot<br>
> void myScene::handleMouseMove()<br>
> {<br>
> // get event position<br>
> int event_pos[2];<br>
> interactorROI->GetEventPosition(event_pos);<br>
> qDebug("Move: x=%d : y=%d\n", event_pos[0], event_pos[1]);<br>
> }<br>
><br>
><br>
><br>
> Unfortunately the mouse release of any button is still dysfunctional, which<br>
> is a travesty as this<br>
> is otherwise a very useful class. I wish someone would fix this.<br>
<br>
<br>
</div>vtkEventQtSlotConnect is functional.<br>
<br>
Your problem is the vtkInteractorStyle also processes the mouse and keyboard<br>
events along with your Qt slots that you have added.<br>
<br>
When vtkInteractorStyle processes mouse down, it grabs focus of mouse and key<br>
events, so you cannot get any mouse or key events until it releases focus.<br>
<br>
For example, vtkInteractorStyleTrackballCamera::OnRightButtonDown calls<br>
this->GrabFocus(this->EventCallbackCommand)<br>
which then calls<br>
this->Interactor->GrabFocus(mouseEvents,keypressEvents)<br>
so only it can get the mouse/key events until it releases focus.<br>
<br>
If you instead do this:<br>
connections->Connect(interactorROI->GetInteractorStyle(), ... );<br>
then you won't have this problem. That prevents vtkInteractorStyle from<br>
processing any VTK events that you are observing.<br>
<font color="#888888"><br>
--<br>
Clinton Stimpson<br>
Elemental Technologies, Inc<br>
Computational Simulation Software, LLC<br>
<a href="http://www.csimsoft.com" target="_blank">www.csimsoft.com</a><br>
</font></blockquote></div><br>