[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:09:17 EDT 2009


Hey Sean,

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

Perhaps vtkCocoaRenderWindowInteractor.mm is the most likely suspect?

Would that give any Cocoa render window the capacity to receive keyboard
events, regardless of the MACOSX_BUNDLE setting for CMake?

Best, Darren



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

> On 3/19/09 2:25 PM, Darren Weber said:
>
> >Looking at the VTK tutorial examples, I see that keyboard events are not
> >captured in Cone5 on OSX (10.5.6).  Although mouse events are fine, the
> >keyboard events are passed off to the most recent application (Terminal in
> >my case).  The Cone5 example was not compiled as an OSX bundle, it was
> >compiled with all the default options set in the VTK-5-2 cvs checkout.  Is
> >there a way to get this working - should I change something in the VTK
> build
> >or just something in the Cone5 build?
>
> Have you read this?
> <http://public.kitware.com/Bug/view.php?id=2025>
>
> I tried TransformProcessType() a few months ago and had decent results,
> you could give it a try...
>
> --
> ____________________________________________________________
> 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/9872b3e0/attachment.htm>


More information about the vtkusers mailing list