Skip to content

Commit

Permalink
Merge pull request #1338 from dantheman39/master
Browse files Browse the repository at this point in the history
BF: Unicode key presses and timestamp in event.py is throwing IndexError
  • Loading branch information
peircej committed Jan 13, 2017
2 parents 7d47842 + 2e670c6 commit 20a022b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions psychopy/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,12 @@ def getKeys(keyList=None, modifiers=False, timeStamped=False):
_last = timeStamped.getLastResetTime()
_clockLast = psychopy.core.monotonicClock.getLastResetTime()
timeBaseDiff = _last - _clockLast
relTuple = [filter(None, (k[0], modifiers and modifiers_dict(k[1]) or None, k[2] - timeBaseDiff)) for k in targets]
relTuple = [filter(None, (k[0], modifiers and modifiers_dict(k[1]) or None, k[-1] - timeBaseDiff)) for k in targets]
return relTuple
elif timeStamped is True:
return [filter(None, (k[0], modifiers and modifiers_dict(k[1]) or None, k[2])) for k in targets]
return [filter(None, (k[0], modifiers and modifiers_dict(k[1]) or None, k[-1])) for k in targets]
elif isinstance(timeStamped, (float, int, long)):
relTuple = [filter(None, (k[0], modifiers and modifiers_dict(k[1]) or None, k[2] - timeStamped)) for k in targets]
relTuple = [filter(None, (k[0], modifiers and modifiers_dict(k[1]) or None, k[-1] - timeStamped)) for k in targets]
return relTuple


Expand Down

0 comments on commit 20a022b

Please sign in to comment.