How to capture mouse move event?

I am struggling with capturing mouse move event.
e.g. I have this custom style and set it to the interactor.

namespace {

  class vtkMouseMoveStyle : public vtkInteractorStyleTrackballCamera
  {
  public:
    static vtkMouseMoveStyle* New();
    vtkTypeMacro(vtkMouseMoveStyle, vtkInteractorStyleTrackballCamera);

    virtual void OnLeftButtonUp() override
    {
      // Forward events
      vtkInteractorStyleTrackballCamera::OnLeftButtonUp();

      
    }

    virtual void OnMouseMove() override
    {
        std::cout << "Mouse moved!";
    }
  };

  vtkStandardNewMacro(vtkMouseMoveStyle);

} // namespace

But the OnMouseMove() method here only fires when I am holding left/right button and moving my mouse.
I would like to capture the event as soon as the cursor location changes inside the viewport. Can anyone point me to the right direction?

Thanks,
Cameron

Are you using Qt by any chance? In Qt, you have to enable mouse tracking in order to get mouse move events also when no button is pressed.