Trouble with data recording (rating scale)

Trouble in my rating recording when i introduce a keyboard component to force end of routine with the key ''space"

Hey !

i’m making a routine where i’m presenting a video lasting 2 minutes. During the 2 minutes a rating scale (EVA) appears for 4 seconds and the participant use the mouse to place the cursor on the scale. There is in total 8 EVAs , which appear one by one roughtly every ten seconds. I’m recording the position on the cursor (EVA response). Next my video component, i used a rating component for each EVA + a code component with the line thisExp.addData( ‘last rating’, nameEVA.markerPlacedAt) in the tab ''End Routine". see photo attached.

I would like to introduce the possibility to stop the video using the space key. I added a keyboard component - lasting during the 2 minuts of the video. I select the option ‘‘end of routine’’ and it’s ok. When I press the space key, the routine is ended.
But…in my data file, there is two problems : if i don’t stop the routine and let it ‘‘normally’’ runs, the last cursor position is not registered (there is ‘none’ instead of the number corresponding to the scale response).
if i stopped the routine, there is the number corresponding to the initial position of the cursor… and no more last cursor position too. so i cannot no that the participant stopped the video before its end.

I would like to code my experiment so as there is the information in the data file when the participant stopped the video without disturbing the recording of the EVA responses - and also the information ‘none’ for the EVAs which had not been presented instead of the initial position of the cursor.

Could you help me to fix it ?

By advance thank you,