Hi vtk-list,<br><br><br><br>I have a question about vtkRenderWindow.<br><br>I don't manage to catch the hits of arrow keys.<br><br>For example, to catch the hit of "Enter", I do something like that :<br><br><br>
<span style="font-family: courier new,monospace;">if (event == vtkCommand::CharEvent)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> { </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> int code = interactor->GetKeyCode(); </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if ( code == 13)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> // CODE</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> } </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<br>It works very well... <br>But can you help me to find what I have to put in the "???" in the following code to catch the arrows ?<br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">if (event == vtkCommand::KeyPressEvent)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
{ </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
int code = ????</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
if ( code == ????(LEFT_ARROW) )</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
{</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
// CODE</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
} <br></span><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
if ( code == ????(RIGHT_ARROW) )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
{</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
// CODE</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
} <br></span><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
if ( code == ????(UP_ARROW) )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
{</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
// CODE</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
} <br></span><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
if ( code == ????(DOWN_ARROW) )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
{</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
// CODE</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
} </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
}</span><br><br><br><font style="font-family: arial,helvetica,sans-serif;" face="verdana,sans-serif">Thank you very much for your help,<br><br><br><br>Regards,<br><br><br><br>Stéphane<br></font>