Skip to content

Conversation

@davidlatwe
Copy link
Collaborator

Motivation

While using arrow keys to navigate tree view or other widgets, key press event often leaks from current focused widget and interfering other Apps. In Maya for example, it accidently performing Maya commands like pickwalking in outliner.

Solution

Overriding main window's keyPressEvent.

Before

73d9704e-5bb1-4259-a877-dd583efd598d

After

396b436b-1739-4b36-836b-eca46e257e30

@davidlatwe davidlatwe requested a review from BigRoy March 9, 2020 10:09
Comment on lines +101 to +108
"""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.
"""
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc string was copied from Creator App.

@tokejepsen
Copy link
Collaborator

Nice work!

Copy link
Collaborator

@BigRoy BigRoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely! :)

@davidlatwe davidlatwe merged commit f8186bf into getavalon:master Mar 10, 2020
@davidlatwe davidlatwe deleted the fix-keyPress-leak branch March 11, 2020 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants