key_lastpressed

This variable contains the scancode of the last key or button pressed. The scancodes are listed in the "key functions" chapter.

Range

0 .. 255

Type:

var, read-only

Example

function test
{	
  while(key_lastpressed != 1) // wait for ESC
 	{
 	  freeze_mode = 1;
 	  wait(1);
 	}
 	freeze_mode = 0;
}	 

See also:

key_..., on_anykey, key_force, shift_sense, key_any