# Example of how to generate a InteractorStyle where mouse click \*\*and\*\* mouse horizontal movement are combined

**URL:** https://discourse.vtk.org/t/example-of-how-to-generate-a-interactorstyle-where-mouse-click-and-mouse-horizontal-movement-are-combined/9632
**Category:** Support
**Tags:** python
**Created:** [October 18, 2022, 8:17am UTC](https://discourse.vtk.org/t/example-of-how-to-generate-a-interactorstyle-where-mouse-click-and-mouse-horizontal-movement-are-combined/9632 "2022-10-18T08:17:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![llobera](https://discourse.vtk.org/user_avatar/discourse.vtk.org/llobera/32/5540_2.png) [@llobera](https://discourse.vtk.org/u/llobera)
#### Post date: [October 18, 2022, 8:17am UTC](https://discourse.vtk.org/t/example-of-how-to-generate-a-interactorstyle-where-mouse-click-and-mouse-horizontal-movement-are-combined/9632/1 "2022-10-18T08:17:15Z")

</div>

I am trying to create my own interactorStyle and I need to be able to change the camera pitch by clicking on the left mouse button **while** moving the mouse horizontally. Can anyone indicate how to achieve this or point towards an example where this or similar is accomplished. Thanks

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nicolas.vuaille/32/5363_2.png) [@nicolas.vuaille](https://discourse.vtk.org/u/nicolas.vuaille)
#### Post date: [October 21, 2022, 8:19am UTC](https://discourse.vtk.org/t/example-of-how-to-generate-a-interactorstyle-where-mouse-click-and-mouse-horizontal-movement-are-combined/9632/2 "2022-10-21T08:19:25Z")

</div>

I think you should use in internal flag toggled by the button pressed and then use a `if` statement in the mouse move handler.

Take a look at this [https://kitware.github.io/vtk-examples/site/Python/Interaction/MouseEvents/](https://kitware.github.io/vtk-examples/site/Python/Interaction/MouseEvents/)
