1.\" $NetBSD: curses_keyname.3,v 1.4 2007/10/25 20:32:40 jdc Exp $ 2.\" Copyright (c) 2002 The NetBSD Foundation, Inc. 3.\" All rights reserved. 4.\" 5.\" This code is derived from software contributed to The NetBSD Foundation 6.\" by Julian Coleman. 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in the 15.\" documentation and/or other materials provided with the distribution. 16.\" 3. Neither the name of The NetBSD Foundation nor the names of its 17.\" contributors may be used to endorse or promote products derived 18.\" from this software without specific prior written permission. 19.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29.\" POSSIBILITY OF SUCH DAMAGE. 30.\" 31.Dd October 17, 2007 32.Dt CURSES_KEYNAME 3 33.Os 34.Sh NAME 35.Nm curses_keyname , 36.Nm keyname 37.Nd curses report key name routine 38.Sh LIBRARY 39.Lb libcurses 40.Sh SYNOPSIS 41.In curses.h 42.Ft "char *" 43.Fn keyname "int key" 44.Sh DESCRIPTION 45The function 46.Fn keyname 47generates a character string containing a description of the key specified in 48.Fa key . 49.Pp 50The string is formatted according to the following table: 51.Bl -column "Meta + control character" "KEY_MIN - KEY_MAX" "String format" 52.It "Description" Ta "Key range" Ta "String format" 53.It Li "Control character" Ta "0 - 31" Ta "^X" 54.It Li "Visible character" Ta "32 - 126" Ta "X" 55.It Li "Delete character" Ta "127" Ta "^?" 56.It Li "Meta + control character" Ta "128 - 158" Ta "M-^X" 57.It Li "Meta + visible character" Ta "159 - 254" Ta "M-X" 58.It Li "Meta + delete character" Ta "255" Ta "M-^?" 59.It Li "Named key" Ta "KEY_MIN - KEY_MAX" Ta "KEY_EXIT" 60.It Li "Unknown key" Ta "" Ta "-1" 61.El 62.Sh SEE ALSO 63.Xr curses_input 3 64.Sh NOTE 65The return value of 66.Fn keyname 67is a static buffer, which will be overwritten on a subsequent call. 68.Sh STANDARDS 69The 70.Nx 71Curses library complies with the X/Open Curses specification, part of the 72Single Unix Specification. 73.Sh HISTORY 74These functions first appeared in 75.Nx 2.0 . 76