Added ShortcutOverride handler for Backspaces, fixing plot delete #313
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added a
QEvent.ShortcutOverride
catch to the utils.py event filter such that as when clicked into a pyqtgraph plot item, the backspace key throws a ShortcutOverride rather than a standard KeyEvent. This allows deleting plot items and any other items depending on pyqtgraph properly.Changed EventTracker eventfilter() function to also catch and handle QEvent.ShortcutOverride types if and only if the key pressed is also Qt.Backspace_Key in order to fix the above issue while not causing any unintended side-effects or breaking any default keyboard shortcuts.
This PR closes #306 .
Developer Testing
Test all existing keyboard shortcuts with this change and make sure they still work.
Reviewer Testing
Here's what you should do to quickly validate my changes:
This change is