<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi--
<br>Actually, I've already looked at the vtk source (although maybe not
in the right places).
<p>I'm interested in code that runs both under windows and unix, and was
hoping for a generic function that operates something like the "SetLeftButtonReleaseMethod"
in the generic RenderWindowInteractor class. Vtk DOES have several key-specific
functions (such as "SetUserMethod" whose content can be changed but is
specific to press of the letter "u") , but I was hoping for a function
that would allow any desired keypress to initiate some new event, is not
limited to the keys vtk defines, and does not require platform-specific
code.
<p> Other cross-platform toolboxes, such as FLTK, do
this nicely and quite transparently. However, if one embeds a vtkRenderWindow
within an fltk box, the fltk box no longer traps the event because the
vtk window is on top. Vtk needs to trap the event, and I can't find the
function to set keypress events properly.
<p>I was hoping there was a function somewhere that my past search had
failed to uncover. Or maybe I misunderstand?
<br>Thanks
<br>Liz
<p>"K.R.Subramanian" wrote:
<blockquote TYPE=CITE>Liz:
<p>You should be ready to look at some vtk source code..
<p>Its not too bad. Take a look at vtkXRenderWindowInteractor first, in
particular the
<br>functions Enable() and Disable () that set up and remove the event
handler (you
<br>will need to do that to change the events that are used in the default
interactor),
<br>and vtkXRenderWindowInteractorCallback(), which contains the event
loop. The KeyPress
<br>event is what you need to mess with, which calls the OnChar method.
<p>Now go into an example InteractorStyle, such as vtkInteractorStyleTrackball,
which
<br>defines the interactions with the trackball model; look at the OnChar
function (virtual,
<br>will be defined for each device using the keyboard).
<p>If you are on Windows, then you should find the vtkWin32RenderWindowInteractor
instead.
<p>Hope this helps.
<p> -- krs
<br>
<br>
<br>
<pre>--
K.R.Subramanian Phone: (704) 547-4872
Department of Computer Science FAX: (704) 547-3516
UNC Charlotte, 228A Kennedy
9201 Univ. City Blvd. Email: krs@cs.uncc.edu
Charlotte, NC 28223-0001 WWW: <a href="http://www.cs.uncc.edu/~krs">http://www.cs.uncc.edu/~krs</a></pre>
</blockquote>
</html>
--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo@public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------