<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Yes, that was my problem.<br>I was aware that when VTK creates a window by its own the mouse move events where handled.<br>But for many reasons create it myself.<br><br>That's why I need to tell to cocoa to accept mouse move events by myself.<br><br><br>&gt; From: sean@rogue-research.com<br>&gt; To: laurentbenoist@hotmail.com; vtkusers@vtk.org<br>&gt; Subject: Re: [vtkusers] MouseMoveEvent bug in Cocoa<br>&gt; Date: Mon, 17 Aug 2009 14:45:40 -0400<br>&gt; <br>&gt; On 8/17/09 6:19 PM, Benoist Laurent said:<br>&gt; <br>&gt; &gt;My first observation was that the mouseMoved: method is never called.<br>&gt; <br>&gt; There's your problem. :)<br>&gt; <br>&gt; &gt;It's quite interesting because the OnMouseMove methode of my<br>&gt; &gt;InteractorStyle is called when you move the mouse AND click in the same time<br>&gt; &gt;but the mouseMoved method of the vtkCocoaGLView like I said is never called.<br>&gt; &gt;<br>&gt; &gt;My vtkCocoaGLView therefore doesn't handle the device events.<br>&gt; &gt;Wrong.<br>&gt; &gt;The same "print Hello" in the keyUp method works well (idem for the<br>&gt; &gt;other events).<br>&gt; &gt;So every event works except the mouseMove event ?!!<br>&gt; &gt;<br>&gt; &gt;After a more specific search, a interesting link was found which explain<br>&gt; &gt;that mouse move events are deactivated by default in Cocoa (in a<br>&gt; &gt;performance matter).<br>&gt; &gt;  http://serenity.uncc.edu/web/ADC/2005/Developer_DVD_Series/April/ADC<br>&gt; &gt;%20Reference%20Library/documentation/Cocoa/Conceptual/BasicEventHandling/<br>&gt; &gt;Tasks/HandlingMouseEvents.html<br>&gt; &gt;<br>&gt; &gt;The answer is :<br>&gt; &gt;  [window setAcceptsMouseMovedEvents:YES];<br>&gt; &gt;<br>&gt; &gt;It's that simple but I've not see it elsewhere before.<br>&gt; <br>&gt; If you look at the VTK code, you'll see:<br>&gt; <br>&gt; - (void)mouseMoved:(NSEvent *)theEvent<br>&gt; {<br>&gt;   // Note: this method will only be called if this view's NSWindow<br>&gt;   // is set to receive mouse moved events.  See setAcceptsMouseMovedEvents:<br>&gt;   // An NSWindow created by vtk automatically does accept such events.<br>&gt; <br>&gt; Are you creating the NSWindow or is VTK?<br>&gt; <br>&gt; -- <br>&gt; ____________________________________________________________<br>&gt; Sean McBride, B. Eng                 sean@rogue-research.com<br>&gt; Rogue Research                        www.rogue-research.com <br>&gt; Mac Software Developer              Montréal, Québec, Canada<br>&gt; <br>&gt; <br><br /><hr />Votre correspondant a choisi Hotmail et profite d'un stockage quasiment illimité. <a href='http://www.windowslive.fr/hotmail/default.asp' target='_new'> Créez un compte Hotmail gratuitement !</a></body>
</html>