You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#! /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.
The text was updated successfully, but these errors were encountered:
Consider the following simple program
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.
The text was updated successfully, but these errors were encountered: