[vtkusers] QVTKRenderWindowInteractor and key events

Patrick Brockmann Patrick.Brockmann at cea.fr
Mon Dec 20 10:08:59 EST 2004


Hi  all,

I have noticed that with the QVTKRenderWindowInteractor class,
a keypress is always detected in UPPERCASE not in lowercase.

 >>> from vtk.qt.QVTKRenderWindowInteractor import *
 >>> QVTKRenderWidgetConeExample()

When press "c" for exemple, "C" is detected.
I have corrected this by a small change to the
VTK-4.4/Wrapping/Python/vtk/qt/QVTKRenderWindowInteractor.py file.

Line 281:
       if ev.key() < 256:
           key = chr(ev.key())
Changed into:
       if ev.key() < 256:
               key=str(ev.text())

I am using VTK at the interim release 4-4 from source
and qt from PyQt-3.8-4mdk rpm on a Linux machine (Mandrake 10.0)

Let me know if you can confirm this bug and if an official correction
can be considered.

Patrick




More information about the vtkusers mailing list