Open paskino opened 1 year ago
Several CharEvent
s are also observed in the vtkRenderWindowInteractor
.
We could consume the events as proposed in this thread
The following code catches the CharEvent
s
or w
and ~doesn't propagate it further~ changes the character so that it is not processed further.
def consumeCharEvent(interactor, event):
if interactor.GetKeyCode() in ['s', 'w']:
interactor.SetKeyCode("")
iren = vtk.vtkRenderWindowInteractor()
iren.AddObserver("CharEvent", consumeCharEvent, 10)
We could use this to add a list of CharEvent
s we want to discard or monitor.
Notice that the viewer styles observers observe KeyPressEvent
rather than CharEvent
.
https://github.com/vais-ral/CILViewer/blob/b811547112352124c1d7d7b668488efd706f36ef/Wrappers/Python/ccpi/viewer/CILViewer2D.py#L38
A lot of keys trigger actions on the viewer. We should allow the user to set which ones are active or not.