[vtkusers] OnKeyRelease

Matt Schmiermund matt at plasticflow.com
Tue Jun 1 16:29:03 EDT 2004


Thanks Andrew, I have made some progress with this
method. I had originally considered it shortly and for
whatever reason decided it wasn't going to work and
moved on.

I have now subclassed
vtkInteractorStyleTrackballCamera as this has my
desired methods of rotation and the like. I have
reimplemented OnKeyPress and OnKeyRelease to set a
variable to rotate, zoom, and pan which the
onLeftButtonDown function checks before taking the
appropriate action. However OnKeyRelease never seems
to be called. When I press 'r' and attempt to rotate
the object it works fine, but when I release 'r' and
try to rotate it with out the r button being down it
still continues. I have a cout at the top of the
OnKeyRelease function that never gets printed during
the running of the program.

Any ideas on why this might be happening?

Thanks,
Matt

--- Andrew Dolgert <ajd27 at cornell.edu> wrote:
> Hi Matt,
> 
> May I suggest an alternate method?  Override
> OnKeyPress() and OnKeyRelease()
> instead of checking the key code during mouse downs.
>  The key code would
> definitely be set correctly during those methods. 
> You could set a variable
> this->IsRotating and check it during the method for
> mouse downs.
> 
> Drew
> 




More information about the vtkusers mailing list