X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=man%2Fcurs_inopts.3x;h=372010bc337385d1ed27fbaf7a0529c19860051e;hp=bfab42f4734c152b34c946ed5063c70a633c4077;hb=beb0f0c6911096ee19815bdf2601c4317d80341f;hpb=71c0306f0824ef2b10c4c5813fb003db48f3012e diff --git a/man/curs_inopts.3x b/man/curs_inopts.3x index bfab42f4..372010bc 100644 --- a/man/curs_inopts.3x +++ b/man/curs_inopts.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_inopts.3x,v 1.14 2010/07/31 16:11:27 tom Exp $ +.\" $Id: curs_inopts.3x,v 1.17 2012/04/28 19:09:15 tom Exp $ .TH curs_inopts 3X "" .na .hy 0 @@ -223,6 +223,42 @@ initializes the terminal state. BSD curses differed from this slightly; it left the echo bit on at initialization, but the BSD \fBraw\fR call turned it off as a side-effect. For best portability, set echo or noecho explicitly just after initialization, even if your program remains in cooked mode. +.PP +When \fBkeypad\fP is first enabled, +ncurses loads the key-definitions for the current terminal description. +If the terminal description includes extended string capabilities, +e.g., from using the \fB\-x\fP option of @TIC@, +then ncurses also defines keys for the capabilities whose names +begin with "k". +The corresponding keycodes are generated and (depending on previous +loads of terminal descriptions) may differ from one execution of a +program to the next. +The generated keycodes are recognized by the \fBkeyname\fP function +(which will then return a name beginning with "k" denoting the +terminfo capability name rather than "K", used for curses key-names). +On the other hand, an application can use \fBdefine_key\fP to establish +a specific keycode for a given string. +This makes it possible for an application to check for an extended +capability's presence with \fItigetstr\fP, +and reassign the keycode to match its own needs. +.PP +Low-level applications can use \fBtigetstr\fP to obtain the definition +of any particular string capability. +Higher-level applications which use the curses \fBwgetch\fP +and similar functions to return keycodes rely upon the order in which +the strings are loaded. +If more than one key definition has the same string value, +then \fBwgetch\fP can return only one keycode. +Most curses implementations (including ncurses) +load key definitions in the order +defined by the array of string capability names. +The last key to be loaded determines the keycode which will be returned. +In ncurses, you may also have extended capabilities interpreted as +key definitions. +These are loaded after the predefined keys, +and if a capability's value is the same as a previously-loaded +key definition, +the later definition is the one used. .SH NOTES Note that \fBecho\fR, \fBnoecho\fR, \fBhalfdelay\fR, \fBintrflush\fR, \fBmeta\fR, \fBnodelay\fR, \fBnotimeout\fR, \fBnoqiflush\fR, @@ -233,10 +269,9 @@ they attempt to restore to normal (`cooked') mode from raw and cbreak modes respectively. Mixing raw/noraw and cbreak/nocbreak calls leads to tty driver control states that are hard to predict or understand; it is not recommended. .SH SEE ALSO -\fBcurses\fR(3X), \fBcurs_getch\fR(3X), \fBcurs_initscr\fR(3X), \fBtermio\fR(7) -.\"# -.\"# The following sets edit modes for GNU EMACS -.\"# Local Variables: -.\"# mode:nroff -.\"# fill-column:79 -.\"# End: +\fBcurses\fR(3X), +\fBcurs_getch\fR(3X), +\fBcurs_initscr\fR(3X), +\fBcurs_util\fR(3X), +\fBdefine_key\fR(3X), +\fBtermio\fR(7)