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

Sean McBride sean at rogue-research.com
Thu Mar 19 19:03:11 EDT 2009


On 3/19/09 3:58 PM, Darren Weber said:

>I'm not yet versed in Cocoa to make the change required.  I can follow
>specific instructions...  I wonder if the keyboard event capture should
>apply at the level of the window or at the level of the interactor?

The snippit you had was good (wrong header though), so just paste it
into the vtkCocoaRenderWindowInteractor constructor:

#include <ApplicationServices/ApplicationServices.h>

ProcessSerialNumber psn = { 0, kCurrentProcess };
OSStatus error = TransformProcessType( &psn,
kProcessTransformToForegroundApplication );
assert (error == noErr);

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtkusers mailing list