OnLeave function is not called by vtkWin32RenderWindowInteractor
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
When the mouse cursor leaves a vtkWin32RenderWindowInteractor derived class, the OnLeave() function is not called. This functionality can be added by setting a timer whenever the mouse moves. When the timer "goes off", a callback is executed that checks to see if the mouse is still in the render window. If the mouse has left the window, a MOUSELEAVE message is sent (which will eventually lead to the OnLeave() function to be called).
I can provide you with code that I used, but all information required to do this can be found at the following link.
http://support.microsoft.com/kb/q183107/
The main thing that needs to be done to the VTK code is that the MOUSEMOVE case (in the vtkHandleMessage2 function of vtkWin32RenderWindowInteractor) must add some code to look something like this.
case WM_MOUSEMOVE: TRACKMOUSEEVENT tme; if (!me->MouseInWindow) { tme.cbSize = sizeof(TRACKMOUSEEVENT); tme.dwFlags = 1; tme.hwndTrack = hWnd; TrackMouseEvent(&tme) }
me->OnMouseMove(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y); break;
Let me know if there is anything more I can do.
Best regards, Jeff Hoerle Duke University