Hello,
I’m creating an experiment where I loop/finish a loop depending on the clicked key.
The example below continues the loop when the participant presses the r
key. When the participant presses the p
or q
key, the loop is finished:
keys = event.getKeys()
for thisKey in keys:
if thisKey == 'r':
redisplay_image_loop.finished = False
elif thisKey =='p' or thisKey == 'q':
redisplay_image_loop.finished = True
The above example works great, but if the keyboard language is set to Hebrew when we start the experiment, the keys are no longer recognized. It only works if the keyboard language is set to English when we run the experiment.
Is there any way to solve this issue? Maybe by checking the key code
of the pressed key?
The keys I need are:
p = פ = 80
q = 81 = /
r = ר = 82
Thanks!