# Bind Callback to Interaction

**URL:** https://discourse.vtk.org/t/bind-callback-to-interaction/7269
**Category:** Web
**Created:** [November 24, 2021, 3:53pm UTC](https://discourse.vtk.org/t/bind-callback-to-interaction/7269 "2021-11-24T15:53:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bernland](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/b19c9b/32.png) [@bernland](https://discourse.vtk.org/u/bernland)
#### Post date: [November 24, 2021, 3:53pm UTC](https://discourse.vtk.org/t/bind-callback-to-interaction/7269/1 "2021-11-24T15:53:47Z")

</div>

What’s the most top-level approach to capturing interactions in VTK.js?

I understand that there are a number of specific methods, such as onMouseMove(), onLeftMouseDown(), etc.

Is there a more general way to capture all such methods?

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [November 24, 2021, 5:48pm UTC](https://discourse.vtk.org/t/bind-callback-to-interaction/7269/2 "2021-11-24T17:48:00Z")

</div>

Are you trying to create an interactor style? Usually you create a class that inherit [vtkInteractorObserver](https://github.com/Kitware/vtk-js/blob/6e82cca81afe646206a1e12baed95b9aab329f73/Sources/Rendering/Core/InteractorObserver/index.js) or use the manipulator style to compose various interactors to specific interaction/modifier.

---

<div class="post-metadata">

### Author: ![bernland](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/b19c9b/32.png) [@bernland](https://discourse.vtk.org/u/bernland)
#### Post date: [November 25, 2021, 8:45am UTC](https://discourse.vtk.org/t/bind-callback-to-interaction/7269/3 "2021-11-25T08:45:22Z")

</div>

Are there any examples on building custom classes that inherit **vtkInteractorObserver**?

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [November 25, 2021, 9:03pm UTC](https://discourse.vtk.org/t/bind-callback-to-interaction/7269/4 "2021-11-25T21:03:52Z")

</div>

All the [interactor styles](https://github.com/Kitware/vtk-js/tree/master/Sources/Interaction/Style) classes
