Title: keypad number presses not properly registered by tk · Issue #9493 · matplotlib/matplotlib · GitHub
Open Graph Title: keypad number presses not properly registered by tk · Issue #9493 · matplotlib/matplotlib
X Title: keypad number presses not properly registered by tk · Issue #9493 · matplotlib/matplotlib
Description: Bug report Bug summary Pressing keypad numbers do not report keys correctly under tkagg+linux, if numlock is active (i.e. when numbers should be reported); numbers are incorrectly reported when numlock is inactive (i.e. when numbers shou...
Open Graph Description: Bug report Bug summary Pressing keypad numbers do not report keys correctly under tkagg+linux, if numlock is active (i.e. when numbers should be reported); numbers are incorrectly reported when num...
X Description: Bug report Bug summary Pressing keypad numbers do not report keys correctly under tkagg+linux, if numlock is active (i.e. when numbers should be reported); numbers are incorrectly reported when num...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/9493
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"keypad number presses not properly registered by tk","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nPressing keypad numbers do not report keys correctly under tkagg+linux, if numlock is active (i.e. when numbers should be reported); numbers are incorrectly reported when numlock is inactive (i.e. when numbers should *not* be reported).\r\n\r\n**Code for reproduction**\r\n\r\n`MPLBACKEND=tkagg python -c 'from pylab import *; gcf().canvas.mpl_connect(\"key_press_event\", lambda event: print(event.key)); show()'`\r\n\r\n**Actual outcome**\r\n\r\nnumbers are printed when numlock is inactive, and vice versa.\r\n\r\n**Expected outcome**\r\n\r\nthe opposite\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: ubuntu\r\n * Matplotlib version: 2.0.2 (but likely irrelevant\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): tkagg\r\n * Python version: 3.6\r\n * Jupyter version (if applicable):\r\n * Other libraries: \r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\n\r\nThis is due to FigureCanvasTkAgg.keyvald using incorrect values for the mapping: it uses the values at http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/key-names.html (KP_0, etc.) but the correct values (in the tk sources themselves...) are at https://github.com/tcltk/tk/blame/a1577313301d5ad9a6e553b359f7e5de2b8f6153/generic/ks_names.h (themselves derived from https://cgit.freedesktop.org/xorg/proto/x11proto/plain/keysymdef.h) and suggests that the numlock state got inverted.\r\n\r\nOn Windows this is irrelevant, keypad presses are reported with a keyval_sym \u003c256 and thus directly converted via ASCII to the correct value. Not sure about the situation under OSX.","author":{"url":"https://github.com/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2017-10-20T18:54:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":14},"url":"https://github.com/9493/matplotlib/issues/9493"}
| 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:ee8e8f36-455e-7a39-1523-6b75a92962c8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 876C:620C2:195DA2F:218DA1A:6A51D3DB |
| html-safe-nonce | 695864b3568a2a0a6f47647f59080e7b457313679749f908150205906a049db9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzZDOjYyMEMyOjE5NURBMkY6MjE4REExQTo2QTUxRDNEQiIsInZpc2l0b3JfaWQiOiIxMjg3ODkzMDM5ODA1NzQ4MTg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | da32470f1369ce29deba07433be712faf2319564773bc5943d40f0474b7b9611 |
| hovercard-subject-tag | issue:267270873 |
| 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/9493/issue_layout |
| twitter:image | https://opengraph.githubassets.com/318971422009270e0258866e26d8f157c4f2eda9bc7395a2e0123d62d22c45e8/matplotlib/matplotlib/issues/9493 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/318971422009270e0258866e26d8f157c4f2eda9bc7395a2e0123d62d22c45e8/matplotlib/matplotlib/issues/9493 |
| og:image:alt | Bug report Bug summary Pressing keypad numbers do not report keys correctly under tkagg+linux, if numlock is active (i.e. when numbers should be reported); numbers are incorrectly reported when num... |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width