[vtkusers] [Java] Removing default shortcut

Jean-Max Redonnet jmax.red at gmail.com
Tue Mar 27 08:04:27 EDT 2018


Hello everyone,

I'm trying to define my own shortcuts for my app, but I can't figure out
how to remove existing shortcuts.

First, I wonder if the best way to do that is using the Swing/AWT
architecture or the VTK one. I tried both, both allow me to define new
shortcuts, but none of them allow me to remove individual default shortcut.

I tried to subclass vtkInteractorStyle as in this example :
https://lorensen.github.io/VTKExamples/site/Cxx/Interaction/KeypressEvents/

The direct C++ to Java translation just do nothing. The custom interactor
style is never called. But default shortcut is still registred ('q' key
quits and so on...)

I also tied to remove all keybord related interactor observers to make the
whole shortcuts managed by Swing/AWT. To do this, I wrote :

        renderWindowInteractor.RemoveObservers("KeyPressEvent");
        renderWindowInteractor.RemoveObservers("KeyReleaseEvent");
        renderWindowInteractor.RemoveObservers("CharEvent");

but it did not work either.

All this stuff seems to work properly with other languages than Java. Is
there is something special with Java ?

I must admit I'm a bit confused. Any help would be gratefully appreciated.
Thanks.

JMR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180327/4b6565fd/attachment.html>


More information about the vtkusers mailing list