[vtkusers] Qt and VTK, QVTKRenderWindowInteractor and key events
Patrick Brockmann
Patrick.Brockmann at cea.fr
Thu Jan 27 11:17:41 EST 2005
Hi all,
I have already posted this mail but received no answer.
As I can see some traffic about Qt and VTK, I resent this related question.
-------------------------------------------------------------------------
I have noticed that with the QVTKRenderWindowInteractor class
from the VTK at the interim release 4-4,
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