# Adding the mouse event to the markup does not take effect

**URL:** <https://discourse.slicer.org/t/adding-the-mouse-event-to-the-markup-does-not-take-effect/24293>\
**Category:** Support\
**Created:** [July 13, 2022, 10:54am UTC](https://discourse.slicer.org/t/adding-the-mouse-event-to-the-markup-does-not-take-effect/24293 "2022-07-13T10:54:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![1023185654](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/1023185654/32/15829_2.png) [@1023185654](https://discourse.slicer.org/u/1023185654)\
**Post date:** [July 13, 2022, 10:54am UTC](https://discourse.slicer.org/t/adding-the-mouse-event-to-the-markup-does-not-take-effect/24293/1 "2022-07-13T10:54:13Z")

</div>

Operating system:18.04.1-Ubuntu  
Slicer version:Slicer-4.13.0  
Expected behavior:Add shortcut keys to the markup add curve node  
Actual behavior:There is no response after you customize the behavior according to the instructions

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 13, 2022, 10:57am UTC](https://discourse.slicer.org/t/adding-the-mouse-event-to-the-markup-does-not-take-effect/24293/2 "2022-07-13T10:57:54Z")

</div>

Markups have changed a lot in recent years. If you use latest `main` documentation then you must use latest `main` Slicer version, which is currently 5.1 (not 4.13). If you find that any of the code snippets does not work even if you use the correct software version then let us know.

---

<div class="post-metadata">

**Author:** ![1023185654](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/1023185654/32/15829_2.png) [@1023185654](https://discourse.slicer.org/u/1023185654)\
**Post date:** [July 13, 2022, 10:59am UTC](https://discourse.slicer.org/t/adding-the-mouse-event-to-the-markup-does-not-take-effect/24293/3 "2022-07-13T10:59:12Z")

</div>

How can I generate a continuous markup controlpoint while dragging the mouse, When I set the left mouse click event to no event, I set the left mouse drag event, but when ENTERING slicer, clicking the left mouse button still generates a Markup node

```auto
markupsWidget.SetEventTranslation(markupsWidget.WidgetStateDefine, vtk.vtkCommand.LeftButtonPressEvent, vtk.vtkEvent.NoModifier, vtk.vtkWidgetEvent.NoEvent)
        markupsWidget.SetEventTranslation(markupsWidget.WidgetStateDefine, vtk.vtkCommand.RightButtonPressEvent, vtk.vtkEvent.NoModifier, vtk.vtkWidgetEvent.NoEvent)
        markupsWidget.SetEventTranslationClickAndDrag(markupsWidget.WidgetStateDefine, vtk.vtkCommand.LeftButtonPressEvent, vtk.vtkEvent.NoModifier, markupsWidget.WidgetStateTranslateControlPoint, markupsWidget.WidgetEventControlPointMoveStart, markupsWidget.WidgetEventControlPointMoveStart)

```

@lassoan
