Glulx - Stop timer when user presses any key

Hi again, not sure exactly how to express this, but I’m trying to write a system to automatically generate an action based on a timer, which is sort of working. For now, every ten seconds, I generate a “flashback” action.



The problem is, as you can see in the second example, the action gets triggered even if I’m part way through typing a command. The way I envision this working, when user presses any key, the timer is stopped, then my Prompt() routine will restart the timer. But just adding a switch for evtype_CharInput in my HandleGlKEvent routine isn’t catching anything.

Any ideas?

Thanks in advance

The input line is not really inspectable in that way. You don’t get events as the player types.

You might be able to rig up something using the no-echo input flag. The event would fire but have no visible effect if there was partial input. However, I don’t have sample code for this, and I suspect it would have some annoying effect on input editing.

Speaking as a player, the first thing I’d learn in such a game is to hit “space” right away to freeze the timer.

Thanks, Zarf, both for the technical info and for the gameplay feedback. I didn’t make it clear that this is not something the user’s going to want to disable, it will more than likely be a one-time thing. So far, I think it works.