Collect keyboard response only on specific trials
I was wondering if there's any way to set the keyboard response to only collect keypresses on some trials? For my experiment, participants need to respond with a keypress only if they see the target appear at certain positions on the screen (top or bottom), but not if the target appears anywhere else. The location of my target is pseudorandomised with the inline script and the order of locations change every block, so I can't use the block loop to specify the correct response.
I hope I'll be able to get some help on this. Thanks!