GETKEY Name
GETKEY Purpose
Return a keyboard key. Interpret escape sequences.
Category
Calling Sequence
k = getkey() Inputs
Keyword Parameters
Keywords
/INIT initializes internal lookup tables, should never
be needed but once was. If arrow keys or other such
escape sequence keys gives wrong value try /INIT.
Outputs
k = key string. Actual key or key name. out
Waits for a key. No type ahead allowed.
Common Blocks
getkey_com Notes
Notes: Key is returned as a string. Keys that produce
escape sequences are interpreted and returned as a single
string. For example the F2 key returns 'F2', the right
arrow key returns 'RIGHT', and so on. Not all keys return
something. To find what a key returns do print,getkey()
and press the desired key.
Has problems if there is a pause between calls to getkey.
Tries to handle problems but cannot always do so. Its
best to type slowly when there are pauses between calls,
like for computations, etc.
Modification History
R. Sterner, 8 Nov, 1989
R. Sterner, 18 Apr, 1990 --- major rewrite.
R. Sterner, 2010 May 07 --- Converted arrays from () to [].
Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
This software may be used, copied, or redistributed as long as it is not
sold and this copyright notice is reproduced on each copy made. This
routine is provided as is without any express or implied warranties
whatsoever. Other limitations apply as described in the file disclaimer.txt.