Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scene.kb.getkey segfault and related issues #9

Open
JohnDenker opened this issue Jul 10, 2016 · 0 comments
Open

scene.kb.getkey segfault and related issues #9

JohnDenker opened this issue Jul 10, 2016 · 0 comments

Comments

@JohnDenker
Copy link

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))
    if len(s):
      print("key event '", s, "'")

Observed behavior:

  1. 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.

  2. The shift, ctrl, and alt keys on the right side of the keyboard, kb.getkey returns a zero-length string.

  3. 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.
    stacktrace.txt

Desired behavior:

  1. 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.

  2. 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.

  3. 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.

  4. Not segfaulting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant