[vtkusers] vtkRenderWindowInteractor - how to disable autorepeat for keyboard

Clinton Stimpson clinton at elemtech.com
Tue Sep 6 10:16:35 EDT 2011


On Tuesday, September 06, 2011 02:12:21 am Laurent Mundeleer wrote:
> Hi everyone,
> I'm facing a problem with the vtkRenderWindowInteractor, which I have
> connected to slots with vtkEventQtSlotConnect. It's working, but :
> the problem is that when a keyboard key is pressed, I receive continous
> event "pressed"-"released"-"pressed"-"released" even if the key is not
> released but kept pressed. I'm not encoutering the same problem with
> mouse buttons for instance.
> Is there a way to disable this "autorepeat" mechanism for keyboard keys
> in vtk ?
> I understand it can be useful when we keep an arrow pressed for example
> to have continuous events propagated, but it doesn't suit my needs.
> 

You can detect if its a repeat by calling 
vtkRenderWindowInteractor::GetRepeatCount().

Or perhaps there is a platform specific method for disabling it.

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com



More information about the vtkusers mailing list