-
Notifications
You must be signed in to change notification settings - Fork 25
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))
if len(s):
print("key event '", s, "'")
Observed behavior:
-
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.
-
The shift, ctrl, and alt keys on the right side of the keyboard, kb.getkey returns a zero-length string.
-
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:
-
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.
-
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.
-
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.
-
Not segfaulting.