Hi Vidyadhar, thank you for you replay.<br>
Yesterday there has been another thread of messages dealing with the same question and, again, the Focus issue has been raised.<br>
I was trying to implement picking using the īpī key, but then I
resolved using mouse events. As to the exit event caused by the `q` and
`e` keys, canīt it be trapped using an observer on the Interactor?<br>
<br>
Thank you<br>
<br>
Luca<br><br><div><span class="gmail_quote">On 3/30/07, <b class="gmail_sendername">vidyadhar</b> <<a href="mailto:vidyadhar@lucidindia.net">vidyadhar@lucidindia.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font face="Arial" size="2">Hi,</font></div>
<div><font face="Arial" size="2">I use win32 only so cannot be sure about other
windowing environments. In win32, mouse events go to window under mouse cursor
so render window, standalone or parented to some other window receives the mouse
events. Keyboard events go to that window which has keyboard focus. This could
be dialog window parent of render window or some deeper nesting (in my case
nesting is very deep, using MDI window with user controls parenting render
window). For this reason, keyboard events are processed in stand alone vtk
window but not if it is parented. Some mechanism has to be set to pass keypress
events from container upto render window interactor. This is tricky and I have
not tried it beyond direct parentage case. A word of caution if you decide to
try this event forwarding. Pressing 'Q', 'q', 'E' and 'e' key which are passed
to interactor can cause the entire application to close down (on win32 the
interactor send quit message to OS).</font></div>
<div><font face="Arial" size="2">HTH</font></div><span class="sg">
<div><font face="Arial" size="2">vidyadhar</font></div></span><div><span class="e" id="q_111a0fa54bdcd362_2">
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-stretch: normal; font-size-adjust: none;">----- Original Message ----- </div>
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-inline-policy: initial; -moz-background-origin: initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-stretch: normal; font-size-adjust: none;">
<b>From:</b>
<a title="lplavorante@gmail.com" href="mailto:lplavorante@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Luca
Pallozzi Lavorante</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-stretch: normal; font-size-adjust: none;"><b>To:</b> <a title="vtkusers@vtk.org" href="mailto:vtkusers@vtk.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
vtkusers@vtk.org</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-stretch: normal; font-size-adjust: none;"><b>Sent:</b> Thursday, March 29, 2007 3:43
AM</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-stretch: normal; font-size-adjust: none;"><b>Subject:</b> [vtkusers] How to activate
KeyPress Events invtkXRenderWindowInteractor?</div>
<div><br></div>Hi everybody,<br>I am trying to use a KeyPressEvent in my
application using some test callback. I have followed the procedure listed
below, but when I press a key nothing happens.<br>Could someone please
tell me if I am missing something?<br>Thank you very much for your
help.<br><br> Luca<br><br>Code:
<br><br>vtkXRenderWindowInteractor *iren =
vtkXRenderWindowInteractor::New();<br><br>vtkCallbackCommand *keyPressCB =
vtkCallbackCommand::New();<br>
keyPressCB->SetClientData(iren);<br> keyPressCB->SetCallback
(keyPressCallback); // keyPressCallback is created elsewhere. It prints
a message.<br> <br>vtkInteractorStyleTrackballCamera *styleTrackball =
vtkInteractorStyleTrackballCamera::New();<br>
styleTrackball->AddObserver(vtkCommand::KeyPressEvent,
keyPressCB);<br><br>iren->SetInteractorStyle(styleTrackball);
</blockquote></span></div></div>
</blockquote></div><br>