Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Mac qt ctrl#21142
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Mac qt ctrl#21142
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -93,10 +93,10 @@ def test_other_signal_before_sigint(qt_core, platform_simulate_ctrl_c, | ||
def custom_sigpipe_handler(signum, frame): | ||
nonlocal sigcld_caught | ||
sigcld_caught = True | ||
signal.signal(signal.SIGCHLD, custom_sigpipe_handler) | ||
def fire_other_signal(): | ||
os.kill(os.getpid(), signal.SIGCHLD) | ||
def fire_sigint(): | ||
platform_simulate_ctrl_c() | ||
@@ -166,24 +166,33 @@ def custom_handler(signum, frame): | ||
@pytest.mark.parametrize( | ||
"qt_key, qt_mods, answer", | ||
[ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I'm not sure why this is "control" rather than "ctrl" here, but it appears to work either way for me locally, and this would get you an easier string replacement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think the issue is that in some cases it is 'ctrl' because it is a modifier, but here it is 'control' because it is the key. If this distinction is a good idea or not is a different issue, but this fails on linux if we change control -> ctrl here. | ||
("Key_A", ["ShiftModifier"], "A"), | ||
("Key_A", [], "a"), | ||
("Key_A", ["ControlModifier"], ("ctrl+a")), | ||
( | ||
"Key_Aacute", | ||
["ShiftModifier"], | ||
"\N{LATIN CAPITAL LETTER A WITH ACUTE}", | ||
), | ||
("Key_Aacute", [], "\N{LATIN SMALL LETTER A WITH ACUTE}"), | ||
("Key_Control", ["AltModifier"], ("alt+control")), | ||
("Key_Alt", ["ControlModifier"], "ctrl+alt"), | ||
( | ||
"Key_Aacute", | ||
["ControlModifier", "AltModifier", "MetaModifier"], | ||
("ctrl+alt+meta+\N{LATIN SMALL LETTER A WITH ACUTE}"), | ||
), | ||
# We do not currently map the media keys, this may change in the | ||
# future. This means the callback will never fire | ||
("Key_Play", [], None), | ||
("Key_Backspace", [], "backspace"), | ||
( | ||
"Key_Backspace", | ||
["ControlModifier"], | ||
"ctrl+backspace", | ||
), | ||
], | ||
ids=[ | ||
'shift', | ||
@@ -216,6 +225,11 @@ def test_correct_key(backend, qt_core, qt_key, qt_mods, answer): | ||
Assert sent and caught keys are the same. | ||
""" | ||
from matplotlib.backends.qt_compat import _enum, _to_int | ||
if sys.platform == "darwin" and answer is not None: | ||
answer = answer.replace("ctrl", "cmd") | ||
answer = answer.replace("control", "cmd") | ||
answer = answer.replace("meta", "ctrl") | ||
result = None | ||
qt_mod = _enum("QtCore.Qt.KeyboardModifier").NoModifier | ||
for mod in qt_mods: | ||