We are trying to program a task in which the routine ends when 6 keys are pressed more or less simultaneously.
We found a solution by introducing a code (see below).
‘’‘if resp1.status == STARTED:
theseKeys = resp1.getKeys(keyList=Touches, waitRelease=False)
_resp1_allKeys.extend(theseKeys)
if len(resp1.keys) > 5:
resp1.keys = [key.name for key in _resp1_allKeys]
resp1.rt = [key.rt for key in _resp1_allKeys]
if (resp1.rt[-1] - resp1.rt[0]) < abs(0.1):
# a response ends the routine
continueRoutine = False
else:
continueRoutine = True
resp1.keys = []
resp1.rt = []
_resp1_allKeys = []
resp1.status = STARTED’’’
It works with 4 keys. However, when extended the number of keys to 5 or 6, it doesn’t work for some combinations of keys (this is not a problem of qwerty/azerty keyboard). We don’t understand why it works for some combinations of letters and not for some others.
Does anybody have an idea which could help us to understand the problem.