[vtkusers] vtkRenderWindowInteractor::GetKeyCode()

Matt Schmiermund matt at plasticflow.com
Thu May 27 15:15:53 EDT 2004


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;
	OnLeftMouseDownFunction
	//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



More information about the vtkusers mailing list