Hello, I am working on an adjustment task in which participants must rotate the line till it matches the orientation they previously saw. They have to press keys until they find a match, which takes a long time. Could you kindly assist me in making it continuous? ( keep rotating the line while holding the key). I can do it locally, but not online as packages do not work for JS. Many thanks.
Thank you Becca. I am not sure if I understand what should I do. My problem is similar to what was asked here (Faster rotation). @wakecarter suggested a solution based on what he did for the screen scale routine (Faster rotation - #8 by wakecarter) but I couldn’t figure it out how to do it.
keys = event.getKeys()
if len(keys):
if t-oldt<.5:
dscale=5*dbase
oldt=t
else:
dscale=dbase
oldt=t
This bit of code says that if you press a key faster than twice per second then you should change the size (or orientation) by 5 times as much as you should if you press keys slower.
This works with multiple key presses, not holding keys down.
Aha OK - that was my mistake I thought it worked for pressing keys down.
In that case - detecting is a key is pressed down is a little verbose in psychoJS can you achieve what you want through a mouse press instead and using