# Modify the keys of the Markups

**URL:** <https://discourse.slicer.org/t/modify-the-keys-of-the-markups/25613>\
**Category:** Development\
**Created:** [October 9, 2022, 2:53am UTC](https://discourse.slicer.org/t/modify-the-keys-of-the-markups/25613 "2022-10-09T02:53:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![miniminic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/miniminic/32/16647_2.png) [@miniminic](https://discourse.slicer.org/u/miniminic)\
**Post date:** [October 9, 2022, 2:53am UTC](https://discourse.slicer.org/t/modify-the-keys-of-the-markups/25613/1 "2022-10-09T02:53:49Z")

</div>

The measurement function of markups is currently right click to indicate the end, I want to change it to middle click to end, right click to rotate the model. I didn’t find anywhere in markups about mouse event handling, how I should do that.

---

<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:** [October 9, 2022, 5:44am UTC](https://discourse.slicer.org/t/modify-the-keys-of-the-markups/25613/2 "2022-10-09T05:44:34Z")

</div>

you can read the code of vtkSlicerMarkupsWidget,may be help

---

<div class="post-metadata">

**Author:** ![miniminic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/miniminic/32/16647_2.png) [@miniminic](https://discourse.slicer.org/u/miniminic)\
**Post date:** [October 9, 2022, 7:05am UTC](https://discourse.slicer.org/t/modify-the-keys-of-the-markups/25613/3 "2022-10-09T07:05:55Z")

</div>

Ok, thanks. I’ll read it

---

<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:** [November 24, 2022, 3:08am UTC](https://discourse.slicer.org/t/modify-the-keys-of-the-markups/25613/4 "2022-11-24T03:08:28Z")

</div>

You can use the `SetEventTranslation` method to change keyboard and mouse event mapping to widget events. You can find examples on this forum and in the script repository.

---

<div class="post-metadata">

**Author:** ![miniminic](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/miniminic/32/16647_2.png) [@miniminic](https://discourse.slicer.org/u/miniminic)\
**Post date:** [November 24, 2022, 3:10am UTC](https://discourse.slicer.org/t/modify-the-keys-of-the-markups/25613/5 "2022-11-24T03:10:57Z")

</div>

Yes, I have found this way. Thank you very much for your answer
