Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > K

keyname(3X)

ENHANCED CURSES
HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

keyname(), key_name() — get name of key

SYNOPSIS

#include <curses.h>

char *keyname(int c);

char *key_name(wchar_t c);

DESCRIPTION

The keyname() and key_name() functions generate a character string whose value describes the key c. The c argument of keyname() can be an 8-bit character or a key code. The c argument of key_name() must be a wide character.

The string has a format according to the first applicable row in the following table:

InputFormat of Returned String
Visible characterThe same character
Control character^X
Meta-character (keyname() only)M-X
Key value in <curses.h> (keyname() only)KEY_name
None of the aboveUNKNOWN KEY

The meta-character notation shown above is used only if meta-characters are enabled.

RETURN VALUE

Upon successful completion, keyname() returns a pointer to a string as described above. Otherwise, it returns a null pointer.

ERRORS

No errors are defined.

APPLICATION USAGE

The return value of keyname() and key_name() may point to a static area which is overwritten by a subsequent call to either of these functions.

Applications normally process meta-characters without storing them into a window. If an application stores meta-characters in a window and tries to retrieve them as wide characters, keyname() cannot detect meta-characters, since wide characters do not support meta-characters.

SEE ALSO

meta(3X), <curses.h>.

CHANGE HISTORY

First released in X/Open Curses, Issue 4.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.