# LeftButtonClickEvent on Markups behavior

**URL:** https://discourse.slicer.org/t/leftbuttonclickevent-on-markups-behavior/8008
**Category:** Development
**Created:** [August 13, 2019, 5:55pm UTC](https://discourse.slicer.org/t/leftbuttonclickevent-on-markups-behavior/8008 "2019-08-13T17:55:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [August 13, 2019, 5:55pm UTC](https://discourse.slicer.org/t/leftbuttonclickevent-on-markups-behavior/8008/1 "2019-08-13T17:55:33Z")

</div>

In Slicer 4.11 nightly, the LeftButtonClickEvent on a markup fiducial results in the “Centered” Jump Slices behavior in the other slice viewers. This jumps the offsets and centers the fiducial in the center of all the other slice viewers.

In Slicer 4.10 this behavior didn’t exist, but I’m looking to keep similar behavior in Slicer 4.11 in certain situations where I want to easily allow left-click-and-drag events, but I don’t want to accidentally allow left-click events which then jumps slices.

@lassoan (markups developer) Would it make more sense for “Click to Jump Slices” in the Markups Module to become an application setting? The “Click to Jump Slices” behavior is currently specific to selecting rows in the table of the Markups module and a qSlicerSimpleMarkupsWidget has its own unique `JumpToSliceEnabled` attribute.

Or is there a way to simply block the LeftButtonClickEvent on markups from being processed?

* * *

## Source Code

`this->SetEventTranslation(WidgetStateOnWidget, vtkMRMLInteractionEventData::LeftButtonClickEvent, vtkEvent::NoModifier, WidgetEventJumpCursor);`  
[source](https://github.com/Slicer/Slicer/blob/1d6c0774786427ccb86d83a4ae8ab4df2dbf244a/Modules/Loadable/Markups/VTKWidgets/vtkSlicerMarkupsWidget.cxx#L64)

The event ends up calling this code to jump slices and center:

> <https://github.com/Slicer/Slicer/blob/11a17936a35ffe4adc06fb541f4c6320f4928faa/Modules/Loadable/Markups/Logic/vtkSlicerMarkupsLogic.cxx#L172-L174>

---

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [August 14, 2019, 10:34pm UTC](https://discourse.slicer.org/t/leftbuttonclickevent-on-markups-behavior/8008/2 "2019-08-14T22:34:15Z")

</div>

If anyone has opinions or other inputs to make Jump Slices behavior more consistent between slice viewer behavior and other widgets that would be great! Thanks

---

<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: [August 14, 2019, 11:25pm UTC](https://discourse.slicer.org/t/leftbuttonclickevent-on-markups-behavior/8008/3 "2019-08-14T23:25:23Z")

</div>

> [@jamesobutler](#):
>
> Would it make more sense for “Click to Jump Slices” in the Markups Module to become an application setting?

Yes, absolutely, that’s the plan. Currently, mapping of GUI events to widget events is implemented in the widget’s constructor, but it is designed so that settings can be stored in a simple series of IDs (interaction event ID, modifiers, widget event ID). It would be great if you could work on overriding mapping from application settings.
