# Segment Editor shortcurts does not work

**URL:** <https://discourse.slicer.org/t/segment-editor-shortcurts-does-not-work/35303>\
**Category:** Development\
**Created:** [April 5, 2024, 7:35am UTC](https://discourse.slicer.org/t/segment-editor-shortcurts-does-not-work/35303 "2024-04-05T07:35:53Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Suhaim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/suhaim/32/81421_2.png) [@Suhaim](https://discourse.slicer.org/u/Suhaim)\
**Post date:** [December 17, 2025, 6:53am UTC](https://discourse.slicer.org/t/segment-editor-shortcurts-does-not-work/35303/3 "2025-12-17T06:53:37Z")

</div>

> [@lassoan](#):
>
> Make sure that after calling `installKeyboardShortcuts` you always call `uninstallKeyboardShortcuts`.

Hi @lassoan, could you please elaborate what you meant here?

Like @SANTIAGO_PENDON_MING tried, I was also disabling the shortcut “Ctrl+Z” with custom logic using -

```auto
def disableShortcut(sequence: str):
    shortcut = qt.QShortcut(slicer.util.mainWindow())
    shortcut.setKey(qt.QKeySequence(sequence))
    shortcut.connect("activated()", lambda: None)

```

After disabling the shortcut once, if I restart the application with the calls to this function removed( therefore no more “Ctrl+z” shortcut override), I am not able to use the shortcut for the segment editor. Like @SANTIAGO_PENDON_MING mentioned, the shortcut doesn’t work anymore. Would you happen to know why?

Found this in another post as well :-

> [@Shortcuts and keys already assigned somewhere else?](https://discourse.slicer.org/t/shortcuts-and-keys-already-assigned-somewhere-else/26632/4):
>
> If you or someone else adds a shortcut with the same key sequence then effectively breaks all actions, as the shortcut will no longer emit `activated()` signal but `activatedAmbiguously()`.
> 
> Unfortunately, I don’t know an easy way to determine where each shortcut comes from where, other than search in the source code of all installed extensions for `shortcut`.
> 
> Extensions should not install any keyboard shortcut by default (without explicitly approved by the user). Also, if any shortcut is added then a meaningful `objectName` should be set, for example containing the name of the extension and module, to make it easier to detect and resolve conflicts by turning off irrelevant shortcuts.

So are you suggesting that I **should not disable “Ctrl+z“ based on custom logic**?

---

_[View the full topic](https://discourse.slicer.org/t/segment-editor-shortcurts-does-not-work/35303)._
