From a4384d52a6b0de3d7ac589ad34e2cf7902200259 Mon Sep 17 00:00:00 2001 From: nrehberg Date: Wed, 5 Feb 2025 17:05:51 +0100 Subject: [PATCH] GraphEditor: Add shortCut (Ctrl+Return) to Show Contents --- python/GafferUI/GraphEditor.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python/GafferUI/GraphEditor.py b/python/GafferUI/GraphEditor.py index 4c292285ea3..6e9f64e6e99 100644 --- a/python/GafferUI/GraphEditor.py +++ b/python/GafferUI/GraphEditor.py @@ -284,7 +284,10 @@ def appendContentsMenuDefinitions( cls, graphEditor, node, menuDefinition ) : return menuDefinition.append( "/ContentsDivider", { "divider" : True } ) - menuDefinition.append( "/Show Contents...", { "command" : functools.partial( cls.acquire, node ) } ) + menuDefinition.append( "/Show Contents...", { + "command" : functools.partial( cls.acquire, node ), + "shortCut" : "Ctrl+Return" + } ) __nodeDoubleClickSignal = GafferUI.WidgetEventSignal() ## Returns a signal which is emitted whenever a node is double clicked. @@ -425,6 +428,10 @@ def __keyPress( self, widget, event ) : selection = self.scriptNode().selection() if len( selection ) > 0 : self.scriptNode().setFocus( selection[0] ) + elif event.key == "Return" and event.modifiers == event.modifiers.Control : + selection = self.scriptNode().selection() + if len( selection ) > 0 : + GraphEditor.acquire( selection[0] ) elif event.key == "Down" : selection = self.scriptNode().selection() if selection.size() == 1 and selection[0].parent() == self.graphGadget().getRoot() :