It does recognise the keyboard, but when you call that function it
discards the key presses so that they don't show up next time.
So your getKeys(['q']) call is made immediately after the key presses
have been cleared and so the list is empty. Make sense?
What you want is this:
from psychopy import visual, core, event
mainWindows = visual.Window(size = (300, 200), monitor = 'testMonitor')
for frame in range(300):
mainWindows.flip()
#check keys
keys = event.getKeys()#store for multiple uses
if len(keys):
print keys
if 'q' in keys:
core.quit()
mainWindows.close()
core.quit()
Jon
> --
> You received this message because you are subscribed to the Google
> Groups "psychopy-users" group.
> To post to this group, send email to
psychop...@googlegroups.com.
> To unsubscribe from this group, send email to
>
psychopy-user...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/psychopy-users/-/NWXHRU8HqAIJ.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>
--
Jonathan Peirce
Nottingham Visual Neuroscience
http://www.peirce.org.uk/