def get_eventnames(file):
    """Return a list of sorted temporal event names in trials."""
    trials = file.intervals['trials']
    event_names = []
    for name in trials.colnames:
        t = trials[name].data[-1]
        try:
            if trials['start_time'][-1] <= t <= trials['stop_time'][-1]:
                event_names.append(name)
        except:
            pass
    ts = [trials[name].data[-1] for name in event_names]
    event_names = [name for _, name in sorted(zip(ts, event_names))]
    return event_names