/*------------------------------------------------------------------------------

Hit ctrl-enter to execute.

Description:

	This scripts shows the ASCII number of keys on the keyboard. This is useful
	if you want to use keys in a script utilizing "GetKey()".
	Press the space bar to terminate the procedure.

	Copyright © 2001 Gatan Inc.

------------------------------------------------------------------------------*/

// Open the results window (!)
OpenResultsWindow()								

// Perform a while loop until space bar is hit	
number key = 0
while(key != 32)								
{	
	// Get the key stroke...
	key = GetKey()
	
	// and if a key has been pressed post the ASCII number to the results window									
	if(key)											
		Result("Key: " + key + "\n")			
}

// Post end of procedure message.
Result("Script terminated\n")					
