I am updating some deprecated code that used to use Pygame to take keyboard inputs “b” and “g”, and since I can no longer use the keyboard input function that was used I was planning on using psychopy. I have written some code but it doesn’t seem to do anything and I was wondering if Im approaching this incorrectly. this is what I have so far:
def Event(self, phase, event):
time.sleep(1)
keys = psychopy.event.waitKeys(keyList=["b", "g"])
if keys != None:
if 'b' in keys:
self.color[:] = [0,1,0]
if 'g' in keys:
self.color[:] = [0,0,1]
else:
pass