EEG triggers for stimuli and keyboard press

OS (e.g. Win10):
Windows 10

PsychoPy version (e.g. 1.84.x):
2023.1.1

What are you trying to achieve?:
I am trying to create a Go/No-Go task with EEG recording. I have 3 different types of stimuli (Go, No-Go and a Blank) and the idea of the test is a participant responds as quickly as possible when they see the ‘go’ stimulus and withhold a response for the no-go.

I would like to have an EEG trigger for the onset of the stimulus (ideally I would like to be able to differentiate between them) and then another trigger sent to the EEG software when the participant responds with a keyboard press (hitting the space key).

What did you try to make it work?:
Using the serial out option in builder, I am currently able to have a trigger appear for a stimulus (but it is the same trigger for all three types) and this is done through the serial port/COM port.
image

What specifically went wrong when you tried that?:
I am able to create a keyboard response trigger, however I am only able to make this happen at the time participants are able to respond, not their actual response time.
image

Does anyone know how to create custom code to mark the response time? I have tried all the examples online and none have succeeded yet
Thank you