[vtkusers] VTK tutorial, step 5 (Cone5), OSX-Cocoa: fails to capture keyboard events

Darren Weber darren.weber.lists at gmail.com
Thu Mar 19 18:48:42 EDT 2009


What about lines 501-503 in vtkCocoaRenderWindow.mm, ie:

    [theWindow makeKeyAndOrderFront:nil];
    [theWindow setAcceptsMouseMovedEvents:YES];

What happens if they are changed to:

    [theWindow makeKeyAndOrderFront:YES];
    [theWindow setAcceptsMouseMovedEvents:YES];

Does that break anything?

Best, Darren




On Thu, Mar 19, 2009 at 3:32 PM, Sean McBride <sean at rogue-research.com>wrote:

> On 3/19/09 3:09 PM, Darren Weber said:
>
> >Thanks for pointing out your bug report - I didn't know how to search for
> >bug reports on VTK.  BTW, I see many of the links in that bug report are
> now
> >broken, but this one survives:
> >http://www.cocoabuilder.com/archive/message/cocoa/2008/12/11/225157
> >
> >So where do you include this tip to use:
> >
> >#include <CoreServices/CoreServices.h>
> >ProcessSerialNumber psn = { 0, kCurrentProcess };
> >TransformProcessType( &psn, kProcessTransformToForegroundApplication );
> >
> >Does this code belong in a VTK Cocoa render class?  I see the following
> >potential locations for this code:
> >
> >VTK/Rendering/vtkCocoaGLView.h
> >VTK/Rendering/vtkCocoaGLView.mm
> >VTK/Rendering/vtkCocoaRenderWindow.h
> >VTK/Rendering/vtkCocoaRenderWindow.mm
> >VTK/Rendering/vtkCocoaRenderWindowInteractor.h
> >VTK/Rendering/vtkCocoaRenderWindowInteractor.mm
>
> Yeah, somewhere there.  I forget where I tried it... you might try
> vtkCocoaRenderWindowInteractor::vtkCocoaRenderWindowInteractor.
>
> >Would that give any Cocoa render window the capacity to receive keyboard
> >events, regardless of the MACOSX_BUNDLE setting for CMake?
>
> Basically, yes.
>
> I'd be interested to hear your results.  It might be a solution to this
> bug at long last, but is something that needs lots of testing.
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090319/50b31892/attachment.htm>


More information about the vtkusers mailing list