[vtkusers] Vtk.js and scroll wheel click

Sebastien Jourdain sebastien.jourdain at kitware.com
Mon Sep 3 23:18:16 EDT 2018


When you register a manipulator you need to specify when it should be
applied, button (1,2,3), modifier (alt, shift, control). If you don't
specify anything that will be the left button with no modifier.
Moreover, you can provide those flags to skip drag or scroll (scrollEnabled:
true, dragEnabled: false)

Since that manipulator is only focusing on mouse drag, you will need to
create another one that do something base on the scroll like here:
https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Manipulators/MouseCameraTrackballZoomManipulator/index.js#L70-L90

You have that example that allow you to dynamically design the user
interaction style
https://github.com/Kitware/vtk-js/blob/master/Sources/Interaction/Style/InteractorStyleManipulator/example/index.js

https://kitware.github.io/vtk-js/examples/InteractorStyleManipulator.html




On Mon, Sep 3, 2018 at 8:28 PM Richard Frank <rickfrank at me.com> wrote:

>
>
>
> In your case, you may have to implement a panManipulator that only deals
> with the mouse wheel/pinch.
>
>
> Do you mean a interactorStyle - hasA - Pan Manipulator?
>
> I tried that and when I add the manipulator it seems to take over all the
> events…..I don’t get the left or right button - when I created the pan
> manipulator I only
> assigned it center button (2)
>
>
> You can look at the zoom one which has an option to support the mouse
> wheel.
>
>
> Do you mean a zoom Manipulator?
>
> I’ll experiment and post some code if I can’t get it working….
>
> Thanks
>
> Rick
>
>
> HTH,
>
> Seb
>
> On Mon, Sep 3, 2018 at 3:44 PM Richard Frank via vtkusers <
> vtkusers at public.kitware.com> wrote:
>
>> Hi
>>
>> I want to use scroll wheel down for Pan in my interactor instead of a
>> modifier key. What’s the best way to do this? I don’t see how to get it in
>> an interactor style and if I add a PanManipulator it seems to take over all
>> the mouse handling.
>>
>> What’s the relationship between an interactor and a manipulator?
>>
>> Thanks
>>
>> Rick Frank
>> _______________________________________________
>> 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://public.kitware.com/mailman/listinfo/vtkusers
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180903/c6c55850/attachment.html>


More information about the vtkusers mailing list