[vtkusers] vtkRenderWindow catch the arrow keys
Stéphane CALANDE
scalande at gmail.com
Fri Nov 14 04:31:10 EST 2008
Thank you very much Denis.
The answer is :
std::string key_sym (interactor->GetKeySym());
if ((key_sym.compare("Up")==0) || (key_sym.compare("KP_Up")==0))
{
// CODE
}
Have a nice day,
Stéphane
2008/11/13 Denis Barbier <bouzim at gmail.com>
> On 2008/11/13 Stéphane CALANDE wrote:
> > Hi vtk-list,
> >
> > I have a question about vtkRenderWindow.
> >
> > I don't manage to catch the hits of arrow keys.
> [...]
> > if (event == vtkCommand::KeyPressEvent)
> > {
> > int code = ????
>
> > if ( code == ????(LEFT_ARROW) )
> > {
> > // CODE
> > }
> [...]
>
> You can set DebugOn on your vtkRenderWindowInteractor to print some useful
> information. vtkRenderWindowInteractor::GetKeyCode returns a char, so it
> won't
> help. I guess that you could use GetKeySym instead and check for
> Left/Right/Up/Down.
> After quickly browsing source files, I believe that these strings are
> platform agnostic,
> but you will have to check if portability is an issue for you.
>
> Denis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081114/e8704046/attachment.htm>
More information about the vtkusers
mailing list