Currently, motion_notify_event generates a MouseEvent with a .button attribute that is generated by dead-reckoning: it fills that value by tracking button_press_events and button_release_events. This means that the value can be wrong (if the user starts pressing a button (keeping it pressed), moves the mouse out of the canvas, presses another button, releases the first one, moves back over the canvas), and also this cannot represent the case of multiple buttons being pressed (for a motion_notify_event, the main thing that makes sense to report is really "what are all pressed buttons", not "what was the last pressed button").
I think (assuming we can get #23473 in, which would mean we agree on this kind of API) we can tag this "good first issue"/"medium" as the new API would be well-defined but the work requires understanding various UI toolkits.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
github-actions commented on Dec 17, 2025
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
QuLogic commented on Dec 17, 2025
This was implemented in #28453, I believe.