# Right Button Press on Markups Fiducial

**URL:** https://discourse.slicer.org/t/right-button-press-on-markups-fiducial/7345
**Category:** Development
**Created:** [June 28, 2019, 2:39am UTC](https://discourse.slicer.org/t/right-button-press-on-markups-fiducial/7345 "2019-06-28T02:39:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![zacbaum](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/zacbaum/32/7166_2.png) [@zacbaum](https://discourse.slicer.org/u/zacbaum)
#### Post date: [June 28, 2019, 2:39am UTC](https://discourse.slicer.org/t/right-button-press-on-markups-fiducial/7345/1 "2019-06-28T02:39:38Z")

</div>

Hello,

I am looking to implement a context menu similar to [this](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Show_a_context_menu_when_a_markup_point_is_clicked_in_a_slice_or_3D_view) one from the script repository - however, I’d like to be able to use a right click instead of a left click with the mouse.

I know that I can do something like the below to create a menu when I right click, but this allows the menu to pop up even if a markup fiducial is not clicked, and doesn’t allow me to pass the fiducial ID through the callData to update the menu accordingly.

```
layoutManager = slicer.app.layoutManager()
redRenderWindow = layoutManager.sliceWidget('Red').sliceView().renderWindow()
style = vtk.vtkInteractorStyleUser()
redRenderWindow.GetInteractor().SetInteractorStyle(style)
style.AddObserver(vtk.vtkCallbackCommand.RightButtonPressEvent, self.analysisWidget.markupCallback)
```

---

<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: [June 28, 2019, 11:15pm UTC](https://discourse.slicer.org/t/right-button-press-on-markups-fiducial/7345/2 "2019-06-28T23:15:52Z")

</div>

Markups are completely reworked in recent 4.11 versions. In these versions you can easily change/add mapping of right-click to an arbitrary markup node event (that you can observe from your module). This is not exposed on any external API though, so you need to [change the source code](https://github.com/Slicer/Slicer/blob/52a4c6c97b7b4589f4c2c79e306786bdf5bfbb21/Modules/Loadable/Markups/VTKWidgets/vtkSlicerMarkupsWidget.cxx#L56) of Slicer and rebuild.
