getKeyName()

You can use the consoleLib.getKeyName() system function to find the EGL name for a key based on a specified code point. The code point depends upon the local character set where the function runs. In ASCII environments, the function expects an ASCII code; in EBCDIC environments, it expects an EBCDIC code.

Syntax

  consoleLib.getKeyName(codePoint INT in)
  returns (result STRING)
codePoint
The code point associated with the key name you want to find.
result
A string containing the EGL name for the key associated with the code point.

Example

The following example requests key input, converts it to a key name, and displays it:

keyName STRING;
...
keyName = consoleLib.getKeyName(consoleLib.getKey());
ConsoleLib.displayAtLine("You pressed " + keyName, 17);

Feedback