Is there a way to disable the keyboard shortcuts related to VtkRenderInteractorWindow

classic Classic list List threaded Threaded
2 messages Options
Jay
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Is there a way to disable the keyboard shortcuts related to VtkRenderInteractorWindow

Jay
I am trying to disable the keyboard shortcuts that come by default with the vtkRenderWindowInteractor like disable 'q','w','r','t','j'... for various events. I intent only to disable the keyboard shortcuts but not to disable the mouse interaction.

I tried using interactor.Disable(); but this disables the mouse interaction.

I also tried to remap the keys using the callback event but I was looking for much simpler ways, if they exists

Sample pseudo code that I wrote is:

tSource = vtksphersource::New();
tsource.setRadius(10);
tSource.Update();
tPolyMapper = vtkPolyDataMapper::New();
tPolyMapper.setInputConnection(tSource.getOutputPort());
tActor = vtkActor::New();
tActor.setMapper(tPolyMapper);

ren = vtkRenderer::New();
window = vtkRenderWindow::New();
interactor = vtkRenderWindownteractor::New();

window.addRenderer(ren);
interactor.setRenderWindow(window);

ren.render();
interactor.Start();


Any suggestion or ideas would be helpful.

Regards
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is there a way to disable the keyboard shortcuts related to VtkRenderInteractorWindow

Bill Lorensen
Look at this example:
https://lorensen.github.io/VTKExamples/site/Cxx/Interaction/KeypressEvents/

It subclasses and interactor to handle key press events.
At the end of the class it
// Forward events
vtkInteractorStyleTrackballCamera::OnKeyPress();

It you don't forward the event, you will be ignoring key presses...


On Fri, Aug 11, 2017 at 9:38 AM, Jay <[hidden email]> wrote:

> I am trying to disable the keyboard shortcuts that come by default with the
> vtkRenderWindowInteractor like disable 'q','w','r','t','j'... for various
> events. I intent only to disable the keyboard shortcuts but not to disable
> the mouse interaction.
>
> I tried using /interactor.Disable();/ but this disables the mouse
> interaction.
>
> I also tried to remap the keys using the callback event but I was looking
> for much simpler ways, if they exists
>
> Sample pseudo code that I wrote is:
>
> /tSource = vtksphersource::New();
> tsource.setRadius(10);
> tSource.Update();
> tPolyMapper = vtkPolyDataMapper::New();
> tPolyMapper.setInputConnection(tSource.getOutputPort());
> tActor = vtkActor::New();
> tActor.setMapper(tPolyMapper);
>
> ren = vtkRenderer::New();
> window = vtkRenderWindow::New();
> interactor = vtkRenderWindownteractor::New();
>
> window.addRenderer(ren);
> interactor.setRenderWindow(window);
>
> ren.render();
> interactor.Start();/
>
> Any suggestion or ideas would be helpful.
>
> Regards
>
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Is-there-a-way-to-disable-the-keyboard-shortcuts-related-to-VtkRenderInteractorWindow-tp5744374.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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:
> http://public.kitware.com/mailman/listinfo/vtkusers



--
Unpaid intern in BillsBasement at noware dot com
_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers
Loading...