# VTK Mouse Drag Implementation

**URL:** https://discourse.vtk.org/t/vtk-mouse-drag-implementation/3480
**Category:** Development
**Created:** [June 6, 2020, 12:19pm UTC](https://discourse.vtk.org/t/vtk-mouse-drag-implementation/3480 "2020-06-06T12:19:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jjjl](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jjjl/32/1929_2.png) [@jjjl](https://discourse.vtk.org/u/jjjl)
#### Post date: [June 6, 2020, 12:19pm UTC](https://discourse.vtk.org/t/vtk-mouse-drag-implementation/3480/1 "2020-06-06T12:19:48Z")

</div>

Hello,

I am developing in python and want to implement a custom mouse drag implementation. When moving the mouse I want the clicked actor to move as well (I know how to do this).

I also know how to fire the mouse move event :`render_window_interactor.AddObserver(vtk.vtkCommand.MouseMoveEvent, lambda obj, ev: mouse_move(obj, ev))`

The challenge is now: How do I know, inside the mouse\_move function, if the left mouse button is pressed and released while the mouse moves ?

Thanks for your help
