Hi Carrie, we need to see the whitespace in your code:
But there do seem to be several sequencing errors apparent with your code (e.g. the mouse is checked only once, outside your function, which runs once per trial). Could you post the code you have with the keypress that does work? It will be very easy to modify that as required.