# Customize keyboard shortcuts in Slicer?

**URL:** <https://discourse.slicer.org/t/customize-keyboard-shortcuts-in-slicer/32891>\
**Category:** Support\
**Created:** [November 18, 2023, 11:40am UTC](https://discourse.slicer.org/t/customize-keyboard-shortcuts-in-slicer/32891 "2023-11-18T11:40:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvergnat](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@mvergnat](https://discourse.slicer.org/u/mvergnat)\
**Post date:** [November 18, 2023, 11:40am UTC](https://discourse.slicer.org/t/customize-keyboard-shortcuts-in-slicer/32891/1 "2023-11-18T11:40:38Z")

</div>

Hello!  
dear all,

I would like to change few keyboard shortcuts:

I work on an echo loop and I am doing somme segmentation.  
to well identify structures, I often need to navigate quickly in the frames.

the normal schortcut to navigate through the frames is  
Ctrl+shift+arrow left/right

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/5/55a7cf976f8e62100824c5fb790f4411753e944a.jpeg)

may i change this shortcut to simply arrow left/right (to work with one hand and leave a hand for mouse).

I saw a 2020 post on this:

> [@How to set or customize keyboard shortcuts in Slicer?](https://discourse.slicer.org/t/how-to-set-or-customize-keyboard-shortcuts-in-slicer/14814):
>
> I have some problems about using Slicer. First, how to set or customize keyboard shortcuts in Slicer? This will make slicer more in line with my habits. In addition, I found that when there are many segments in the scene, the display of all view windows is delayed, especially when using tools such as Paint or Draw effect. How to avoid it? I will be appreciate for the help, thanks!

**BUT:**  
the link quoted is not anymore functional…  
[https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Customize\_keyboard\_shortcuts](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Customize_keyboard_shortcuts)  
**AND:**  
if we could find a solution **without Pithon programmimg** would be better…I am not a programmer…

Many thx for help!!  
mathieu

---

<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 20, 2023, 5:04pm UTC](https://discourse.slicer.org/t/customize-keyboard-shortcuts-in-slicer/32891/2 "2023-11-20T17:04:38Z")

</div>

The Slicer script repository has moved to readthedocs: [Script repository — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#keyboard-shortcuts-and-mouse-gestures)

Arrow keys are used for so many things that it may be rarely remain unassigned, so I would recommend to use other keys. For example, you can use the q and w keys to move to previous/next frame:

```python
# Load some sequence
# (this is just for testing, it is not needed if a sequence is already in the scene)
import SampleData
sequenceNode = SampleData.SampleDataLogic().downloadSample("CTPCardioSeq")

# Define functions to step to the next/previous item

def stepNext():
    sequenceBrowserNode = slicer.util.getModule('Sequences').toolBar().activeBrowserNode()
    sequenceBrowserNode.SelectNextItem(1)

def stepPrevious():
    sequenceBrowserNode = slicer.util.getModule('Sequences').toolBar().activeBrowserNode()
    sequenceBrowserNode.SelectNextItem(-1)

# Create keyboard shortcuts for the functions

shortcutNext = qt.QShortcut(slicer.util.mainWindow())
shortcutNext.setKey(qt.QKeySequence('w'))
shortcutNext.connect('activated()', stepNext)

shortcutPrevious = qt.QShortcut(slicer.util.mainWindow())
shortcutPrevious.setKey(qt.QKeySequence('q'))
shortcutPrevious.connect('activated()', stepPrevious)

```

---

<div class="post-metadata">

**Author:** ![lalamax3d](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lalamax3d/32/69164_2.png) [@lalamax3d](https://discourse.slicer.org/u/lalamax3d)\
**Post date:** [January 31, 2024, 8:41am UTC](https://discourse.slicer.org/t/customize-keyboard-shortcuts-in-slicer/32891/3 "2024-01-31T08:41:32Z")

</div>

thanks for idea., i want to ask, is it possible to assign keyboard shortcut to default modules ( Data / Volumes / Models / Transforms … )  
keys like 1,2,3… (alpha) by any chance, in my case, this will really help speed up
