Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sisoe24 committed Sep 2, 2021
1 parent fe9a09b commit dbf77cf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion KnobScripter/knob_scripter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,17 @@ class KnobScripterPane(KnobScripter):
def __init__(self, node = "", knob="knobChanged"):
super(KnobScripterPane, self).__init__(isPane=True, _parent=QtWidgets.QApplication.activeWindow())
ctrlS_shortcut = QtWidgets.QShortcut(QtGui.QKeySequence("Ctrl+S"), self)
ctrlS_shortcut.activatedAmbiguously.connect(self.saveClicked)
self.installEventFilter(self)

def eventFilter(self, obj, event):
"""Intercept shortcut override behavior."""
if (event.type() == QtCore.QEvent.ShortcutOverride) and (isinstance(event, QtGui.QKeyEvent)):
if event.modifiers() == Qt.CTRL and event.key() == Qt.Key_S:
self.saveClicked()
event.accept()
return True

return super(KnobScripterPane, self).eventFilter(obj, event)

def showEvent(self, the_event):
try:
Expand Down

0 comments on commit dbf77cf

Please sign in to comment.