Title: [ENH]: Add buttons (plural) attribute to mouseevents · Issue #23490 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: Add buttons (plural) attribute to mouseevents · Issue #23490 · matplotlib/matplotlib
X Title: [ENH]: Add buttons (plural) attribute to mouseevents · Issue #23490 · matplotlib/matplotlib
Description: Problem 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 w...
Open Graph Description: Problem 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_ev...
X Description: Problem 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_ev...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23490
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: Add buttons (plural) attribute to mouseevents","articleBody":"### Problem\n\nCurrently, 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\").\n\n### Proposed solution\n\nSimilarly to #23473, one could add a `.buttons` attribute (a frozenset of MouseButtons) to MouseEvents (well, at least to those generated by motion_notify_event) and fill that accordingly, as UI toolkits typically report that info (e.g. https://doc.qt.io/qt-6/qsinglepointevent.html#buttons, compare with https://doc.qt.io/qt-6/qsinglepointevent.html#button).\r\n\r\nI 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.","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2022-07-26T09:06:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/23490/matplotlib/issues/23490"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0f5de0d5-024c-cb2c-a679-a1d970097d65 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 85F0:C92EC:12C9875:191B53B:6A52A5E2 |
| html-safe-nonce | aa7cf10d5e4c40f9774efafdaabf9e401d68deb1b900b1e873fb8d64aaf28c56 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUYwOkM5MkVDOjEyQzk4NzU6MTkxQjUzQjo2QTUyQTVFMiIsInZpc2l0b3JfaWQiOiIzNTk2MTQ1ODgyMTU0ODM3NDc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ab62f14ac861e87e39bcebdea18cc581f48c80e6b874890bdf198d92bd40b03c |
| hovercard-subject-tag | issue:1317930952 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/23490/issue_layout |
| twitter:image | https://opengraph.githubassets.com/643c6070a7d499c094c79e3abd95afd8d8e2991c9e53ce1d15d0d940977c7ae9/matplotlib/matplotlib/issues/23490 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/643c6070a7d499c094c79e3abd95afd8d8e2991c9e53ce1d15d0d940977c7ae9/matplotlib/matplotlib/issues/23490 |
| og:image:alt | Problem 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_ev... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width