Hi
I need to get the exact position of one of my stimulus “exactly” after the keyboard press. Would you please help me? the exact position is very important.
Hi
I need to get the exact position of one of my stimulus “exactly” after the keyboard press. Would you please help me? the exact position is very important.
@Michael
Can you help me please?
We need more information.
Is this in a custom-written script, or in Builder?
How are you detecting the keyboard press?
But in essence, every visual stimulus has a .pos
attribute. You can just access that at the time the keypress is detected.
It’s a custom-written script.
I have a clock. there is a clock hand which it’s position is changing in each frame. I need to get the clock hand position at the moment of the keyboard press.
I have written this code in the “each frame” tab:
if Target_Response.getKeys() == ['k'] or ['s']:
press_pos = clock_hand_1.pos
but it doesn’t work.
Those things contradict each other: one day s that you wrote the script yourself, the other that you are using a Builder experiment, with code components.
That isn’t the expression you are after: it is comparing the pressed key to the result of “or
ing” two values. It should be more explicit, like:
if Target_Response.getKeys() == ['k'] or Target_Response.getKeys() == ['s']:
or:
if Target_Response.getKeys()[0] in ['k', 's']:
This doesn’t tell us anything useful. How doesn’t it work?