Title: scene.kb.getkey segfault and related issues · Issue #9 · vpython/visual · GitHub
Open Graph Title: scene.kb.getkey segfault and related issues · Issue #9 · vpython/visual
X Title: scene.kb.getkey segfault and related issues · Issue #9 · vpython/visual
Description: Consider the following simple program #! /usr/bin/python from __future__ import print_function from visual import * while 1: rate(30) if scene.kb.keys: # check for key event s = scene.kb.getkey() # get keyboard info print("len:", len(s))...
Open Graph Description: Consider the following simple program #! /usr/bin/python from __future__ import print_function from visual import * while 1: rate(30) if scene.kb.keys: # check for key event s = scene.kb.getkey() #...
X Description: Consider the following simple program #! /usr/bin/python from __future__ import print_function from visual import * while 1: rate(30) if scene.kb.keys: # check for key event s = scene.kb.getkey() #...
Opengraph URL: https://github.com/vpython/visual/issues/9
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"scene.kb.getkey segfault and related issues","articleBody":"Consider the following simple program\n\n```\n#! /usr/bin/python\n\nfrom __future__ import print_function\nfrom visual import *\n\nwhile 1:\n rate(30)\n if scene.kb.keys: # check for key event\n s = scene.kb.getkey() # get keyboard info\n print(\"len:\", len(s))\n if len(s):\n print(\"key event '\", s, \"'\")\n```\n\nObserved behavior:\n\n1) For the shift, ctrl, and alt keys on the left side of the keyboard, when pressed by themselves, kb.keys sees no events at all.\n\n2) The shift, ctrl, and alt keys on the right side of the keyboard, kb.getkey returns a zero-length string.\n\n3) For the keys XF86WakeUp (151), XF86Back (165), and XF86Forward (166), kb.getkey produces a segmentation fault. This is 100% reproducible chez moi. A stack trace is attached.\n[stacktrace.txt](https://github.com/vpython/visual/files/356177/stacktrace.txt)\n# \n\nDesired behavior:\n\n1) It would be very useful to have a way of knowing whether or not each shift, ctrl, and alt key is down at any given time. The existing kb.keys / kb.getkey interface does not attempt to provide this information. I could not find any alternative interface that did.\n\n2) Specific suggestion, it would be nice to have some way to obtain the standard \"event\" structures, including standard keyup / keypress / kendown events, via the polling interface.\n\n3) The event-driven interface would be even better, but that only works in vpython 6, which is not presently supported on linux platforms. And no, my users are not going to install wine.\n\n4) Not segfaulting.\n","author":{"url":"https://github.com/JohnDenker","@type":"Person","name":"JohnDenker"},"datePublished":"2016-07-10T20:06:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/9/visual/issues/9"}
| 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:3ebf7991-1208-2d1c-0062-ffacd343796d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7D0:3930F2:A689732:D754C47:69766632 |
| html-safe-nonce | 617d1fac6aa4401209fceef7d8c63f75be443cdc807941616e3be5d90f285846 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0QwOjM5MzBGMjpBNjg5NzMyOkQ3NTRDNDc6Njk3NjY2MzIiLCJ2aXNpdG9yX2lkIjoiNTkyMzQ1MjM1OTA1NTY2NDY5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6392eabbc891717684fe1520e27bf81393193e9adefdbd6c026acad52cb82e3f |
| hovercard-subject-tag | issue:164731532 |
| 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/vpython/visual/9/issue_layout |
| twitter:image | https://opengraph.githubassets.com/298775a2eaa6542128e861ebf96964dc6aa4f351ba3d67f2efd94e11dd901b54/vpython/visual/issues/9 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/298775a2eaa6542128e861ebf96964dc6aa4f351ba3d67f2efd94e11dd901b54/vpython/visual/issues/9 |
| og:image:alt | Consider the following simple program #! /usr/bin/python from __future__ import print_function from visual import * while 1: rate(30) if scene.kb.keys: # check for key event s = scene.kb.getkey() #... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JohnDenker |
| hostname | github.com |
| expected-hostname | github.com |
| None | 032152924a283b83384255d9489e7b93b54ba01da8d380b05ecd3953b3212411 |
| turbo-cache-control | no-preview |
| go-import | github.com/vpython/visual git https://github.com/vpython/visual.git |
| octolytics-dimension-user_id | 1280757 |
| octolytics-dimension-user_login | vpython |
| octolytics-dimension-repository_id | 3045458 |
| octolytics-dimension-repository_nwo | vpython/visual |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3045458 |
| octolytics-dimension-repository_network_root_nwo | vpython/visual |
| 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 | 5b577f6be6482e336e3c30e8daefa30144947b17 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width