summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Doc/Zsh/mod_curses.yo7
-rw-r--r--Src/Modules/curses.c12
3 files changed, 22 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2fd6cb9a2..cbe2ac8ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2007-11-06 Peter Stephenson <pws@csr.com>
+ * 24069: Doc/Zsh/mod_curses.yo, Src/Modules/curses.c: add
+ $zcurses_keycodes.
+
* 24068: Src/builtin.c: attempt to make `printf "%g\n" -0'
output "-0", although this depends on the vagaries of the
library's strtod() (works on Solaris, doesn't on Fedora 7).
diff --git a/Doc/Zsh/mod_curses.yo b/Doc/Zsh/mod_curses.yo
index f83951de3..993584ea1 100644
--- a/Doc/Zsh/mod_curses.yo
+++ b/Doc/Zsh/mod_curses.yo
@@ -176,6 +176,13 @@ item(tt(zcurses_colors))(
Readonly array. The colors supported by tt(zsh/curses); available
as soon as the module is loaded.
)
+vindex(zcurses_keycodes)
+item(tt(zcurses_keycodes))(
+Readonly array. The values that may be returned in the second
+parameter supplied to `tt(zcurses input)' in the order in which they
+are defined internally by curses. Not all function keys
+are listed, only tt(F0); curses reserves space for tt(F0) up to tt(F63).
+)
vindex(zcurses_windows)
item(tt(zcurses_windows))(
Readonly array. The current list of windows, i.e. all windows that
diff --git a/Src/Modules/curses.c b/Src/Modules/curses.c
index c9e4ec134..08fe0099b 100644
--- a/Src/Modules/curses.c
+++ b/Src/Modules/curses.c
@@ -1210,6 +1210,16 @@ static const struct gsu_array zcurses_attrs_gsu =
static char **
+zcurses_keycodesgetfn(UNUSED(Param pm))
+{
+ return zcurses_pairs_to_array(keypad_names);
+}
+
+static const struct gsu_array zcurses_keycodes_gsu =
+{ zcurses_keycodesgetfn, arrsetfn, stdunsetfn };
+
+
+static char **
zcurses_windowsgetfn(UNUSED(Param pm))
{
LinkNode node;
@@ -1254,6 +1264,8 @@ static struct paramdef partab[] = {
&zcurses_colorsarr_gsu, NULL, NULL),
SPECIALPMDEF("zcurses_attrs", PM_ARRAY|PM_READONLY,
&zcurses_attrs_gsu, NULL, NULL),
+ SPECIALPMDEF("zcurses_keycodes", PM_ARRAY|PM_READONLY,
+ &zcurses_keycodes_gsu, NULL, NULL),
SPECIALPMDEF("zcurses_windows", PM_ARRAY|PM_READONLY,
&zcurses_windows_gsu, NULL, NULL),
SPECIALPMDEF("ZCURSES_COLORS", PM_INTEGER|PM_READONLY,