Skip to content
Permalink
Browse files

BF: Return keys if maxWait <= 0

  • Loading branch information...
ariekahn committed May 11, 2019
1 parent 4ffc99e commit e33f733f317de81c5b6c97cfe9d8912f0e01ff52
Showing with 6 additions and 1 deletion.
  1. +6 −1 psychopy/iohub/client/keyboard.py
@@ -394,7 +394,7 @@ def waitForKeys(self, maxWait=None, keys=None, chars=None, mods=None,
Returned events are sorted by time.
:param maxWait: Maximum seconds method waits for >=1 matching event.
If 0.0, method functions the same as getKeys().
If <=0.0, method functions the same as getKeys().
If None, the methods blocks indefinitely.
:param keys: Include events where .key in keys.
:param chars: Include events where .char in chars.
@@ -427,6 +427,11 @@ def pumpKeys():
win32MessagePump()
return key

# Don't wait if maxWait is <= 0
if maxWait <= 0:
key = pumpKeys()
return key

while getTime() < (timeout - checkInterval * 2):
# Pump events on pyglet windows if they exist
ltime = getTime()

0 comments on commit e33f733

Please sign in to comment.
You can’t perform that action at this time.