I'd like to be able to remove all automatic keyboard bindings within my mayavi scenes. There are some keyboard events that freeze up my user interface, and may confuse or shut out the user if accidentally pressed.
My first attempt was setting scene_class=Scene
in the traitsui class instead of scene_class=MayaviScene
:
view = View(Item('scene', editor = SceneEditor(scene_class=Scene),
height=100, width=500, show_label=False),
resizable=True,
)
but this only removes the Mayavi header on the scene.
The manual, found at http://mayavi.sourceforge.net/docs/guide/guide.pdf
, goes over the many key binding events, but provides no word on deactivating them.
Any help would be greatly appreciated.
I never figured out how to set an EventFilter for Mayavi, but the reason for the freezing was apparently an outdated library... not sure which one though.
Whenever p
(for picker) was pressed, the entire program froze out (no camera movement or changes to figure allowed from then on out), with the error:
traits.trait_errors.TraitError: The 'coordinate' trait of a DefaultPickHandler instance must be an array of float64 values with shape (3,) or None, but a value of array([ 20.602077 , 7.36959457, -21.24352776]) <type 'numpy.ndarray'> was specified.
I reinstalled my environment as follows (macOS) and the program no longer freezes:
conda create --no-default-packages -n FOO python=2.7
conda install vtk=6.3
conda install mayavi
It should be noted that the error message still displays in bash, but is nonlethal.