[vtkusers] [Java] Removing default shortcut

Jean-Max Redonnet jmax.red at gmail.com
Wed Mar 28 10:25:38 EDT 2018


Thanks for taking my problem into consideration

I'm using vtkRenderWindowPanel which inherits from vtkCanvas which inherits
from vtkPanel (as far I can believe Eclipse).

Hope this may help.

jMax


2018-03-27 17:02 GMT+02:00 Sebastien Jourdain <
sebastien.jourdain at kitware.com>:

> Are you using vtkPanel or vtkCanvas or something else to bring the
> rendering into the Java GUI?
>
> I see hard coded key press handling within vtkPanel (r, u, w, s).
>
> Seb
>
> On Tue, Mar 27, 2018 at 6:04 AM, Jean-Max Redonnet <jmax.red at gmail.com>
> wrote:
>
>> 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
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> https://vtk.org/mailman/listinfo/vtkusers
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180328/1acd1cf8/attachment.html>


More information about the vtkusers mailing list