Is there a way to record multiple keypresses without having to decide how many total keypresses are needed?

For example, participants will be given 5 minutes to do a free-thinking task (so just sit there and think). During the 5 minutes, the participant will be asked to indicate using a keypress or mouseclick whenever a specific thought comes to mind. Is there any way to program a computerized counter like this on DirectRT?