Title: How to get mods keysym names from keysym numbers · Issue #272 · python-xlib/python-xlib · GitHub
Open Graph Title: How to get mods keysym names from keysym numbers · Issue #272 · python-xlib/python-xlib
X Title: How to get mods keysym names from keysym numbers · Issue #272 · python-xlib/python-xlib
Description: I needed to return for Shift dynamically Shift_L so I wrote this code and my question is whether part of the code marked as here could become part of this lib: import Xlib.XK mods_to_indexes_x11 = { "Shift": Xlib.X.ShiftMapIndex, "Lock":...
Open Graph Description: I needed to return for Shift dynamically Shift_L so I wrote this code and my question is whether part of the code marked as here could become part of this lib: import Xlib.XK mods_to_indexes_x11 = ...
X Description: I needed to return for Shift dynamically Shift_L so I wrote this code and my question is whether part of the code marked as here could become part of this lib: import Xlib.XK mods_to_indexes_x11 = ...
Opengraph URL: https://github.com/python-xlib/python-xlib/issues/272
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to get mods keysym names from keysym numbers","articleBody":"I needed to return for `Shift` dynamically `Shift_L` so I wrote this code and my question is whether part of the code marked as `here` could become part of this lib:\r\n\r\n```\r\nimport Xlib.XK\r\n\r\nmods_to_indexes_x11 = {\r\n \"Shift\": Xlib.X.ShiftMapIndex,\r\n \"Lock\": Xlib.X.LockMapIndex,\r\n \"Control\": Xlib.X.ControlMapIndex,\r\n \"Mod1\": Xlib.X.Mod1MapIndex,\r\n \"Mod2\": Xlib.X.Mod2MapIndex,\r\n \"Mod3\": Xlib.X.Mod3MapIndex,\r\n \"Mod4\": Xlib.X.Mod4MapIndex,\r\n \"Mod5\": Xlib.X.Mod5MapIndex\r\n }\r\n\r\nif display and mod_name in mods_to_indexes_x11:\r\n\r\n mods = display.get_modifier_mapping()\r\n first_keycode = mods[mods_to_indexes_x11[mod_name]][0]\r\n if first_keycode:\r\n key = EV_KEY.codes[int(first_keycode) - 8]\r\n keysym = display.keycode_to_keysym(first_keycode, 0)\r\n\r\n \t# here\r\n for key in Xlib.XK.__dict__:\r\n if key.startswith(\"XK\") and Xlib.XK.__dict__[key] == keysym:\r\n return key[3:]\r\n # here\r\n```","author":{"url":"https://github.com/ldrahnik","@type":"Person","name":"ldrahnik"},"datePublished":"2024-04-17T13:54:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/272/python-xlib/issues/272"}
| 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:e4381c6a-a50d-73be-41ea-0b94aad35d3e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB36:100738:24BB49:3235B1:696FE673 |
| html-safe-nonce | 3d31e9e1e603060fd34decc8031b7f59055ad0c617ba5ccbb1aa9d67eb72fd5d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjM2OjEwMDczODoyNEJCNDk6MzIzNUIxOjY5NkZFNjczIiwidmlzaXRvcl9pZCI6IjI3NzQ3Mjk0NDgyOTQ5NjY4OTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 54eabc5aa2843c46eadec8ca277350e347ad07834a1e3a0cb7a3819e1ae2f31e |
| hovercard-subject-tag | issue:2248362709 |
| 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/python-xlib/python-xlib/272/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0c5e71ecb8f4b60385c5673f8c3ec627e19f6ce5ad96a7c5ee37ce7c124be645/python-xlib/python-xlib/issues/272 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0c5e71ecb8f4b60385c5673f8c3ec627e19f6ce5ad96a7c5ee37ce7c124be645/python-xlib/python-xlib/issues/272 |
| og:image:alt | I needed to return for Shift dynamically Shift_L so I wrote this code and my question is whether part of the code marked as here could become part of this lib: import Xlib.XK mods_to_indexes_x11 = ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ldrahnik |
| hostname | github.com |
| expected-hostname | github.com |
| None | bb7c872aa74896d911608183f4997f8b9c121a1624064705ec4570cd91bd7839 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-xlib/python-xlib git https://github.com/python-xlib/python-xlib.git |
| octolytics-dimension-user_id | 16151530 |
| octolytics-dimension-user_login | python-xlib |
| octolytics-dimension-repository_id | 47391866 |
| octolytics-dimension-repository_nwo | python-xlib/python-xlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 47391866 |
| octolytics-dimension-repository_network_root_nwo | python-xlib/python-xlib |
| 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 | 257e1b418957178bd3ac9f7520608a40ebbb0f1e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width