help with defining new events based on other event timing

External Email - Use Caution

Hi MNErs.
I?m rather new to MNE, and am used to working with brainvision instead.
I can not figure out to create a new event based on whether other specific events are in a specifed
Proximity (is there a function to do this?). I see there is merge events but this does not seem to
provide what I need.

To explain, I have loads of stimulus locked triggers which are sent by a light stimulus so are perfect fortiming ? this Is what I want to timelock my ERPs to. However, the light stimulus is always called the same event, e.g., ?lightsensor?.
In Brainvision, I would create my segments based on the subsequent triggers/events, as they tell me what stimulus the light sensor relates to.

e.g., on every trial, I have ?Lightsensor? followed within 100ms by either ?Negative? or ?neutral?.

How do I create an event so that the lightsensor is can be coded as ?Negative? and ?Neutral? when appropriate?

Thank you!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20191023/dccc9fec/attachment.html

External Email - Use Caution

https://mne.tools/stable/generated/mne.event.define_target_events.html#mne.event.define_target_events

External Email - Use Caution

Beautiful - don't how I missed it. Thank you.
Getting the hang of this thing.