[vtkusers] vtkRenderWindowInteractor::GetKeyCode()

Matt Schmiermund matt at plasticflow.com
Sun May 30 15:10:27 EDT 2004


I'm still having problems with the GetKeyCode function
in vtkRenderWindowInteractor. I have looked at the
other vtkInteractorStyles and I believe I am using the
function correctly. I have searched google with no
results and the docs for this class on the vtk website
are absolutly worthless. So I'm getting pretty
desperate here. 

-Matt Schmiermund

--- Matt Schmiermund <matt at plasticflow.com> wrote:
> I have subclasses vtkInteractorStyle and I am
> currently trying to get the left mouse button only
> cause my actor to rotate when the r button is
> pressed.
> 
> void myInteractorStyle::OnLeftButtonDown()
> {
>     
>     cout << "in left button down" << endl;
>     
>     char blar = winInt->GetKeyCode();
>     cout << blar << endl;
>     
>     if ( blar == 'r' || blar == 'R' )
>     {
> 	
> 	cout << "should be rotating" << endl;
> 	//vtkInteractorStyle::OnLeftButtonDown();
> 	//this->Superclass::OnLeftButtonDown();
> 	this->StartRotate();
>     }
> }
> 
> I'm not sure if "this->StartRotate() is correct or
> not
> but I saw it in one of the included interactor
> styles.
> One way or the other...with my couts I am getting 
> "in left button down" and then a box type thing
> instead of 'r' which is what I expect to see.
> 
> winInt is my vtkQtRenderWindowInteractor, which is
> subclassed from vtkRenderWindowInteractor.
> 
> If anyone can tell me why GetKeyCode isn't returning
> r
> I would appreciate it.
> 
> -Matt Schmiermund
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list