summaryrefslogtreecommitdiffstats
path: root/keymap.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-10-07 17:07:04 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-10-07 17:07:04 +0000
commit4bb6cfc49878fa27d9a7a9d0e309b1ebacb24d97 (patch)
treee65db7c2f882f82be16b39899d8a9b9b75cbedb4 /keymap.c
parent322419252b593ded82d2db53c68a0930f35ae807 (diff)
The attached patch fixes a minor inconsistency between the display
of special key-names in the help screen and their actual usage. The help screen now shows the special keys exactly as you would/could/should use them in the muttrc/command-line. (From: Vikas Agnihotri <VikasA@att.com>)
Diffstat (limited to 'keymap.c')
-rw-r--r--keymap.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/keymap.c b/keymap.c
index 5f792e8a..af6b97d5 100644
--- a/keymap.c
+++ b/keymap.c
@@ -67,6 +67,9 @@ static struct mapping_t KeyNames[] = {
{ "<End>", KEY_END },
{ "<Enter>", KEY_ENTER },
{ "<Return>", M_ENTER_C },
+ { "<Esc>", '\033' },
+ { "<Tab>", '\t' },
+ { "<Space>", ' ' },
{ NULL, 0 }
};
@@ -431,25 +434,12 @@ static void create_bindings (struct binding_t *map, int menu)
char *km_keyname (int c)
{
- static char buf[5];
+ static char buf[10];
char *p;
if ((p = mutt_getnamebyvalue (c, KeyNames)))
return p;
- switch (c)
- {
- case '\033':
- return "ESC";
- case ' ':
- return "SPC";
- case '\n':
- case '\r':
- return "RET";
- case '\t':
- return "TAB";
- }
-
if (c < 256 && c > -128 && iscntrl ((unsigned char) c))
{
if (c < 0)
@@ -465,7 +455,7 @@ char *km_keyname (int c)
snprintf (buf, sizeof (buf), "\\%d%d%d", c >> 6, (c >> 3) & 7, c & 7);
}
else if (c >= KEY_F0 && c < KEY_F(256)) /* this maximum is just a guess */
- sprintf (buf, "F%d", c - KEY_F0);
+ sprintf (buf, "<F%d>", c - KEY_F0);
else if (IsPrint (c))
snprintf (buf, sizeof (buf), "%c", (unsigned char) c);
else