Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid keyPress event interfering other widgets #529

Merged
merged 1 commit into from
Mar 10, 2020

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