diff --git a/mayaModule/skeleposer/scripts/skeleposerEditor/ui.py b/mayaModule/skeleposer/scripts/skeleposerEditor/ui.py index 4a6a893..80a2b5e 100644 --- a/mayaModule/skeleposer/scripts/skeleposerEditor/ui.py +++ b/mayaModule/skeleposer/scripts/skeleposerEditor/ui.py @@ -968,20 +968,21 @@ def contextMenuEvent(self, event): return menu = QMenu(self) - - menu.addAction("Add", self.addPoseItem, "Insert") - + menu.addAction("Add", self.addPoseItem) if self.selectedItems(): - menu.addAction("Duplicate", self.duplicatePoseItem, "Ctrl-D") + menu.addAction("Duplicate", self.duplicatePoseItem) + menu.addSeparator() + menu.addAction("Remove", self.removePoseItem) - menu.addAction("Remove", self.removePoseItem, "Delete") menu.popup(event.globalPos()) def keyPressEvent(self, event): ctrl = event.modifiers() & Qt.ControlModifier if ctrl: + print("ctrl", Qt.Key_D, event.key()) if event.key() == Qt.Key_D: + self.duplicatePoseItem() elif event.key() == Qt.Key_Insert: @@ -1085,30 +1086,14 @@ def __init__(self, **kwargs): def contextMenuEvent(self, event): menu = QMenu(self) - menu.addAction("Add", self.addPatternItem, "Insert") - + menu.addAction("Add", self.addPatternItem) if self.selectedItems(): - menu.addAction("Duplicate", self.duplicatePatternItem, "Ctrl-D") + menu.addAction("Duplicate", self.duplicatePatternItem) + menu.addSeparator() + menu.addAction("Remove", self.removePatternItem) - menu.addAction("Remove", self.removePatternItem, "Delete") menu.popup(event.globalPos()) - def keyPressEvent(self, event): - ctrl = event.modifiers() & Qt.ControlModifier - - if ctrl: - if event.key() == Qt.Key_D: - self.duplicatePatternItem() - - elif event.key() == Qt.Key_Insert: - self.addPatternItem() - - elif event.key() == Qt.Key_Delete: - self.removePatternItem() - - else: - super(PatternTableWidget, self).keyPressEvent(event) - def validateItem(self, item): self.blockSignals(True) if item.column() == 1: