Shortcuts and keys already assigned somewhere else?

Most of these shortcuts work for me (except the S and s, which you broke for yourself by redefining).

Try these:

shortcuts = [
  ('p', lambda: print('pressed: p')),
  ('z', lambda: print('pressed: z')),
  ('q', lambda: print('pressed: q')),
  ('f', lambda: print('pressed: f')),
  ('[', lambda: print('pressed: [')),
  (']', lambda: print('pressed: ]')),
  ('\\', lambda: print('pressed: \\')),
  (';', lambda: print('pressed: ;')),
  ('`', lambda: print('pressed: `')),
  ('~', lambda: print('pressed: ~')),
  ('Ctrl+m', lambda: print('pressed: Ctrl-m')),
  ('S', lambda: print('pressed: S')),
  ('O', lambda: print('pressed: O')),
  ('U', lambda: print('pressed: U')),
  ('D', lambda: print('pressed: D')),
]

for (shortcutKey, callback) in shortcuts:
    shortcut = qt.QShortcut(slicer.util.mainWindow())
    shortcut.setKey(qt.QKeySequence(shortcutKey))
    shortcut.connect( 'activated()', callback)

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.