diff --git a/avalon/tools/loader/app.py b/avalon/tools/loader/app.py index 9e6dc35ab..09b3a3f73 100644 --- a/avalon/tools/loader/app.py +++ b/avalon/tools/loader/app.py @@ -276,7 +276,8 @@ def keyPressEvent(self, event): self.show_grouping_dialog() return - return super(Window, self).keyPressEvent(event) + super(Window, self).keyPressEvent(event) + event.setAccepted(True) # Avoid interfering other widgets def show_grouping_dialog(self): subsets = self.data["model"]["subsets"] diff --git a/avalon/tools/projectmanager/app.py b/avalon/tools/projectmanager/app.py index bd360c3c4..6e7a3bbaf 100644 --- a/avalon/tools/projectmanager/app.py +++ b/avalon/tools/projectmanager/app.py @@ -97,6 +97,16 @@ def __init__(self, parent=None): self.echo("Connected to project: {0}".format(project_name)) + def keyPressEvent(self, event): + """Custom keyPressEvent. + + Override keyPressEvent to do nothing so that Maya's panels won't + take focus when pressing "SHIFT" whilst mouse is over viewport or + outliner. This way users don't accidently perform Maya commands + whilst trying to name an instance. + + """ + def refresh(self): self.data["model"]["assets"].refresh() diff --git a/avalon/tools/sceneinventory/app.py b/avalon/tools/sceneinventory/app.py index 155868991..d95d21d12 100644 --- a/avalon/tools/sceneinventory/app.py +++ b/avalon/tools/sceneinventory/app.py @@ -899,6 +899,16 @@ def __init__(self, parent=None): tools_lib.refresh_family_config_cache() + def keyPressEvent(self, event): + """Custom keyPressEvent. + + Override keyPressEvent to do nothing so that Maya's panels won't + take focus when pressing "SHIFT" whilst mouse is over viewport or + outliner. This way users don't accidently perform Maya commands + whilst trying to name an instance. + + """ + def refresh(self): with tools_lib.preserve_expanded_rows(tree_view=self.view, role=self.model.UniqueRole): diff --git a/avalon/tools/workfiles/app.py b/avalon/tools/workfiles/app.py index 0435736bc..e388cf1de 100644 --- a/avalon/tools/workfiles/app.py +++ b/avalon/tools/workfiles/app.py @@ -788,6 +788,16 @@ def __init__(self, parent=None): self.resize(900, 600) + def keyPressEvent(self, event): + """Custom keyPressEvent. + + Override keyPressEvent to do nothing so that Maya's panels won't + take focus when pressing "SHIFT" whilst mouse is over viewport or + outliner. This way users don't accidently perform Maya commands + whilst trying to name an instance. + + """ + def on_task_changed(self): # Since we query the disk give it slightly more delay tools_lib.schedule(self._on_task_changed, 100, channel="mongo")