Waiting for a specific key

I can’t find the method to wait for a specific key to proceed. :frowning:

Specifically, the enter key.

I know I had a thing that worked but I can’t find it. The downside of saving all the work means I’ve saved all the work. Meaning I can’t find anything I need because there’s too much to look for.

Emily Short’s “Basic Screen Effects” extension is well worth putting into nearly any Inform game. It gives commands to “pause the game” which prompts the player to press space to continue, “wait for any key”, and “clear the screen” easily, as well as offering some color change and status line manipulation options.

Sadly, “space” is the wrong key. :frowning: it’s for immersion.

and i have BSE in there - WFAK is too good to pass up. no game should be without it.

Definition: a number is intro-relevant if it is less than 0 or it is 9 or it is at least 32. to say stuff: say "this stuff is left out because spoiler."; let the key be zero; while the key is not intro-relevant: let the key be the chosen letter; if the key is -6 [ENTER]: say line break; say "this stuff is left out because spoiler."; wait for any key; clear the screen; otherwise: do nothing;The goal is to not do anything unless the player hits enter. I can’t work it out.

To plagiarise shamelessly from BSE:

To wait for the/-- ENTER key:
	(- ENTERPause(); -).
	
Include (-

[ ENTERPause i;
	while (i ~= -6)
	{
		i = VM_KeyChar();	
	}
];

-).

This defines the instruction

Wait for the ENTER key.

Warning: I don’t know how robust this is.

I had to google what robust means. works though. :slight_smile: thanks!