# Does the VTKCommand InteractionEvent also gets triggered when we use the mouse wheel?

**URL:** https://discourse.vtk.org/t/does-the-vtkcommand-interactionevent-also-gets-triggered-when-we-use-the-mouse-wheel/12055
**Category:** Development
**Created:** [July 28, 2023, 4:45pm UTC](https://discourse.vtk.org/t/does-the-vtkcommand-interactionevent-also-gets-triggered-when-we-use-the-mouse-wheel/12055 "2023-07-28T16:45:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![adityaDas](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/b9bd4f/32.png) [@adityaDas](https://discourse.vtk.org/u/adityaDas)
#### Post date: [July 28, 2023, 4:45pm UTC](https://discourse.vtk.org/t/does-the-vtkcommand-interactionevent-also-gets-triggered-when-we-use-the-mouse-wheel/12055/1 "2023-07-28T16:45:50Z")

</div>

I am using the callback function that is supposed to get triggered every time there is an interaction with the objects in the scene. For that, I am using the VTKCommand InteractionEvent. However, what I have noticed is that when we are just using the mouse wheel to zoom in or out (without loving the mouse), it does not seem to trigger an event with InteractionEvent. I was wondering if that is supposed to be the case? If it is, are there any alternatives to InteractionEvent that triggers an Event the moment an interaction happens including for zooming in and out?

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [July 28, 2023, 7:20pm UTC](https://discourse.vtk.org/t/does-the-vtkcommand-interactionevent-also-gets-triggered-when-we-use-the-mouse-wheel/12055/2 "2023-07-28T19:20:54Z")

</div>

> I was wondering if that is supposed to be the case?

I think the interactor should emit `InteractionEvent` for mouse wheel actions in addition to other mouse actions.

> If it is, are there any alternatives to InteractionEvent that triggers an Event the moment an interaction happens including for zooming in and out?

Not at the moment. However, you can add the same callback for the `MouseWheelForwardEvent` and `MouseWheelBackwardEvent` in addition to `InteractionEvent`.

```auto
iren->AddObserver(vtkCommand::InteractionEvent, cmd);
iren->AddObserver(vtkCommand::MouseWheelForwardEvent, cmd);
iren->AddObserver(vtkCommand::MouseWheelBackwardEvent, cmd);

```
