[vtkusers] Intercepting a keypress with vtkInteractorStyleSwitch

andyjk andrewkeeling at hotmail.com
Sat Mar 10 14:48:02 EST 2012


Can anyone help - this is driving me mad !

I am trying to read a keypress and so have copied the 'keypress' example on
the wiki :
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/KeypressEvents

However, I was using vtkInteractorStyleSwitch, and not
vtkInteractorTrackballCamera (as in the example) because I need the user to
be able to switch between styles.

The example works fine with vtkInteractorTrackballCamera, but if I
substitute the following in the new KeyPressInteractorStyle class:

class KeyPressInteractorStyle : public vtkInteractorStyleTrackballCamera
with
class KeyPressInteractorStyle : public vtkInteractorStyleSwitch

vtkTypeMacro(KeyPressInteractorStyle, vtkInteractorStyleTrackballCamera);
with
vtkTypeMacro(KeyPressInteractorStyle, vtkInteractorStyleSwitch);


vtkInteractorStyleTrackballCamera::OnKeyPress();
with
vtkInteractorStyleSwitch::OnKeyPress();

the interactor operates correctly but I don't get any outputs from the cout
statements saying keys were pressed.

Is it not possible to override a keypress if I am using
vtkInteractorStyleSwitch or am I doing something wrong ? 

Thanks

Andy

--
View this message in context: http://vtk.1045678.n5.nabble.com/Intercepting-a-keypress-with-vtkInteractorStyleSwitch-tp5553563p5553563.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list