[vtkusers] vtkRenderWindow catch the arrow keys

Stéphane CALANDE scalande at gmail.com
Thu Nov 13 11:55:35 EST 2008


Hi vtk-list,



I have a question about vtkRenderWindow.

I don't manage to catch the hits of arrow keys.

For example, to catch the hit of "Enter", I do something like that :


if (event == vtkCommand::CharEvent)
      {
      int code = interactor->GetKeyCode();
      if ( code == 13)
          {
                 // CODE
          }
      }

It works very well...
But can you help me to find what I have to put in the  "???" in the
following code to catch the arrows ?


if (event == vtkCommand::KeyPressEvent)
      {
      int code = ????
      if ( code == ????(LEFT_ARROW) )
          {
                 // CODE
          }

       if ( code == ????(RIGHT_ARROW) )
           {
                  // CODE
           }

       if ( code == ????(UP_ARROW) )
           {
                  // CODE
           }

       if ( code == ????(DOWN_ARROW) )
           {
                  // CODE
           }
      }


Thank you very much for your help,



Regards,



Stéphane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081113/3d6555a3/attachment.htm>


More information about the vtkusers mailing list