<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>> From: sean@rogue-research.com<br>> To: laurentbenoist@hotmail.com; vtkusers@vtk.org<br>> Subject: Re: [vtkusers] MouseMoveEvent bug in Cocoa<br>> Date: Mon, 17 Aug 2009 14:45:40 -0400<br>> <br>> On 8/17/09 6:19 PM, Benoist Laurent said:<br>> <br>> >My first observation was that the mouseMoved: method is never called.<br>> <br>> There's your problem. :)<br>> <br>> >It's quite interesting because the OnMouseMove methode of my<br>> >InteractorStyle is called when you move the mouse AND click in the same time<br>> >but the mouseMoved method of the vtkCocoaGLView like I said is never called.<br>> ><br>> >My vtkCocoaGLView therefore doesn't handle the device events.<br>> >Wrong.<br>> >The same "print Hello" in the keyUp method works well (idem for the<br>> >other events).<br>> >So every event works except the mouseMove event ?!!<br>> ><br>> >After a more specific search, a interesting link was found which explain<br>> >that mouse move events are deactivated by default in Cocoa (in a<br>> >performance matter).<br>> > http://serenity.uncc.edu/web/ADC/2005/Developer_DVD_Series/April/ADC<br>> >%20Reference%20Library/documentation/Cocoa/Conceptual/BasicEventHandling/<br>> >Tasks/HandlingMouseEvents.html<br>> ><br>> >The answer is :<br>> > [window setAcceptsMouseMovedEvents:YES];<br>> ><br>> >It's that simple but I've not see it elsewhere before.<br>> <br>> If you look at the VTK code, you'll see:<br>> <br>> - (void)mouseMoved:(NSEvent *)theEvent<br>> {<br>> // Note: this method will only be called if this view's NSWindow<br>> // is set to receive mouse moved events. See setAcceptsMouseMovedEvents:<br>> // An NSWindow created by vtk automatically does accept such events.<br>> <br>> Are you creating the NSWindow or is VTK?<br>> <br>> -- <br>> ____________________________________________________________<br>> Sean McBride, B. Eng sean@rogue-research.com<br>> Rogue Research www.rogue-research.com <br>> Mac Software Developer Montréal, Québec, Canada<br>> <br>> <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>