# How to forbidden left and right mouse event on vtkMRMLMarkupsLineNode

**URL:** <https://discourse.slicer.org/t/how-to-forbidden-left-and-right-mouse-event-on-vtkmrmlmarkupslinenode/24833>\
**Category:** Development\
**Created:** [August 19, 2022, 1:27pm UTC](https://discourse.slicer.org/t/how-to-forbidden-left-and-right-mouse-event-on-vtkmrmlmarkupslinenode/24833 "2022-08-19T13:27:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay1987](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jay1987/32/16183_2.png) [@jay1987](https://discourse.slicer.org/u/jay1987)\
**Post date:** [August 19, 2022, 1:27pm UTC](https://discourse.slicer.org/t/how-to-forbidden-left-and-right-mouse-event-on-vtkmrmlmarkupslinenode/24833/1 "2022-08-19T13:27:51Z")

</div>

i made a line node like the picture  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/2/8264fe08e98637c8d6a54adf4cf7978b3976b79b.png)  
and i want the line node to not react on mouse left and mouse right event  
how to do it in the C++ or python Code?

---

<div class="post-metadata">

**Author:** ![Sunderlandkyl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sunderlandkyl/32/79987_2.png) [@Sunderlandkyl](https://discourse.slicer.org/u/Sunderlandkyl)\
**Post date:** [August 19, 2022, 3:26pm UTC](https://discourse.slicer.org/t/how-to-forbidden-left-and-right-mouse-event-on-vtkmrmlmarkupslinenode/24833/2 "2022-08-19T15:26:27Z")

</div>

You can lock the markups node to prevent interaction.

#### From the Markups module:

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/3/03538f036ec032e49be2c58b72b5bfb1e30f6363.png)

#### From Python/C++:

```python
getNode("MarkupsLine").SetLocked(True)

```

---

<div class="post-metadata">

**Author:** ![jay1987](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jay1987/32/16183_2.png) [@jay1987](https://discourse.slicer.org/u/jay1987)\
**Post date:** [August 20, 2022, 2:37am UTC](https://discourse.slicer.org/t/how-to-forbidden-left-and-right-mouse-event-on-vtkmrmlmarkupslinenode/24833/3 "2022-08-20T02:37:42Z")

</div>

> [@Sunderlandkyl](#):
>
> `SetLocked(True)`

thank you ,it’s very useful for me
