You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shift+Arrow key events not detected in osx backend #9835
Now when I run this code and press Shift+Left Arrow, the qt5 backend correctly detects this event as shift+left. However, the osx backend (which AFAIK is the default backend on macOS) doesn't register the shift key at all, I only get left. Is it possible to fix this somehow?
Adding that for me and rebuilding does get me shift events, but as you expected, shift + g produces "shift+G". It looks like the Qt backend has a list of special keys it looks for first, then it assumes characters and removes the shift modifier.
Activity
dstansby commentedon Nov 22, 2017
I delved into the key handling recently, I'll have a look at see if I can do anything
cbrnr commentedon Nov 22, 2017
Awesome! Let me know if I can be of any help!
dstansby commentedon Nov 22, 2017
I've tracked it back to the OSX c code, which converts whatever the key press event is to a char here:
matplotlib/src/_macosx.m
Line 2622 in 813d842
Unfortunately I don't really do C, so someone else is going to have to figure it out from here
dstansby commentedon Nov 22, 2017
And I'm guessing this is the function that needs to be modified somehow:
matplotlib/src/_macosx.m
Lines 2558 to 2617 in 813d842
cbrnr commentedon Nov 22, 2017
This looks promising. I wonder if it as easy as adding
in line 2608... but I guess this needs to be restricted to only a subset of keys such as the arrow keys.
dopplershift commentedon Nov 22, 2017
Adding that for me and rebuilding does get me shift events, but as you expected, shift + g produces "shift+G". It looks like the Qt backend has a list of special keys it looks for first, then it assumes characters and removes the shift modifier.
jklymak commentedon Nov 23, 2017
@cbrnr Have a look at #9836 if you are able to download development versions....
cbrnr commentedon Nov 29, 2017
Closing since #9836 was merged.