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
mpl_connect event.key has 'alt' prepended in matplotlib 1.2 on windows #2302
Comments
Note: This issue is still present in v1.3.0. |
Thanks for this @Ferguzz. Which backend are you using? WxAgg? |
TkAgg. Switching to WxAgg does fix this problem. |
It seems that the bitmask associated with 'alt' as defined in backend_tkagg.py (line 457) is incorrect. I don't have means to test on other systems but on mine a shift of 17 corresponds to 'alt', not a shift of 3. |
Thanks @Ferguzz - sounds like this could be very platform specific. Might be worth looking if we can get hold constants that the Tkinter backend defines to avoid having to put Are you up for investigating this possibility further? Thanks! |
Sure. I'll check it out. |
I'm not surprised that TkAgg and WxAgg have different behavior. The key handling infrastructure is completely independent between backends. Is there any chance you could write a couple tests for the correct interpretation of a key event? I can help out on the Mac & Linux side. If you want a template, I added a few tests for key handling the QT4 backend (#2273). |
I can reproduce this bug / alt prepending on windows7 python2.7.3 matplotlib1.2 and windows7 python2.7.5. matplotlib1.3. It do not have the problems on linux python2.7.5 matplotlib1.2. and windows7 python2.7.3 matplotlib1.1. As mentioned by @Ferguzz backend_tkagg.py (line 457) should be 17 on windows. IMHO there is a platform specific hack for darwin on line 460 already, so why not adding just another one for windows... I tried to look into a platform independent way. I do not find the explanation for the bit magic in the link of line 449 http://effbot.org/tkinterbook/tkinter-events-and-bindings.htm. I think I am missing expertise or was this page updated? Seems like the tcl people also hard-code it to 17 http://wiki.tcl.tk/4238. Sorry, I just do not have enough GUI programming expertise... Matplotlib is great, keep up the good work! |
more information here: http://stackoverflow.com/questions/13933005/update-to-matplotlib-prepends-alt-to-keyrelease-event-key/
I'm running 32-bit xp. seems others on win7 and 64-bit systems are having the same issues.
The text was updated successfully, but these errors were encountered: