-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Simplify handling of Qt modifier keys. #14507
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
Conversation
rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No deprecation, as these can't be properly deprecated anyways.
You can deprecate anything. It's just a matter of writing an entry into the deprecations list. What you cannot do here is warn the user when he uses the deprecated variables (well at least not before 3.7).
I may be overly catious but this seems like some people will have used it. So I'm in favor of a proper depreaction.
- Add a deprecation note. We're at least formally safe. People could have read the deprecation notes before switching to a new version.
- For Py3.7+ use module-level getattr to warn.
|
||
The ``MODIFIER_KEYS``, ``SUPER``, ``ALT``, ``CTRL``, and ``SHIFT`` global | ||
variables of the :mod:`matplotlib.backends.backend_qt4` and | ||
:mod:`matplotlib.backends.backend_qt5` modules have been removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Use the native Qt modifiers instead."
Restored with deprecation notice. Let's leave module-level getattr until we set up some generic helpers for them (I had a PR somewhere demo'ing how to do that...). |
b850318
to
c935bb7
Compare
Doc build failures:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modulo doc build.
- Replace MODIFIER_KEYS by a simpler private table that doesn't include the names used by Matplotlib ("super"/"alt"/...), instead just get these names from SPECIAL_KEYS (this avoids having to also update _MODIFIER_KEYS for osx, where we use different names). - Deprecate the globals SUPER, ALT, CTLR, SHIFT which were just indices into MODIFIER_KEYS but otherwise meaningless. - Invert the order of _MODIFIERS_KEYS to avoid having to do a `reverse()` later in the code. - Get max_unicode value from Python's sys module.
PR Summary
the names used by Matplotlib ("super"/"alt"/...), instead just get
these names from SPECIAL_KEYS (this avoids having to also update
_MODIFIER_KEYS for osx, where we use different names).
into MODIFIER_KEYS but otherwise meaningless.
reverse()
later in the code.No deprecation, as these can't be properly deprecated anyways.
Goes on top of #14506.
PR Checklist