Ho to check for left button single click event vs click and drag event

Hi Paulo,

Thanks for your response. I have managed to find a solution to my problem. Not sure if it is the best one but it works.

I prefer to use observers then I do not have to do the whole inheritance thing. I added a callback method to my vtkInteractorStyleTrackballCamera object using the vtkCommand::LeftButtonPressEvent and the vtkCommand::LeftButtonReleaseEvent (on the same method).

I then record the mouse pointer location on the LeftButtonPressEvent and compare it to when the mouse button is released (LeftButtonReleaseEvent). If they match I then do my stuff. That is it.

Regards,
Daniel

1 Like