mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 08:33:17 +01:00
Sync OpenBSD patchset 193:
Accept and print "Enter" and "Escape" for keys rather than C-m and C-[.
This commit is contained in:
parent
de7483a114
commit
deaba44835
13
key-string.c
13
key-string.c
@ -1,4 +1,4 @@
|
||||
/* $Id: key-string.c,v 1.21 2009-07-28 22:37:02 tcunha Exp $ */
|
||||
/* $Id: key-string.c,v 1.22 2009-07-28 23:13:00 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -58,6 +58,8 @@ struct {
|
||||
{ "Tab", '\011' },
|
||||
{ "BTab", KEYC_BTAB },
|
||||
{ "BSpace", KEYC_BSPACE },
|
||||
{ "Enter", '\r' },
|
||||
{ "Escape", '\033' },
|
||||
|
||||
/* Arrow keys. */
|
||||
{ "Up", KEYC_UP },
|
||||
@ -177,6 +179,11 @@ key_string_lookup_key(int key)
|
||||
return (tmp2);
|
||||
}
|
||||
|
||||
for (i = 0; i < nitems(key_string_table); i++) {
|
||||
if (key == key_string_table[i].key)
|
||||
return (key_string_table[i].string);
|
||||
}
|
||||
|
||||
if (key >= 32 && key <= 255) {
|
||||
tmp[0] = key;
|
||||
tmp[1] = '\0';
|
||||
@ -191,9 +198,5 @@ key_string_lookup_key(int key)
|
||||
return (tmp);
|
||||
}
|
||||
|
||||
for (i = 0; i < nitems(key_string_table); i++) {
|
||||
if (key == key_string_table[i].key)
|
||||
return (key_string_table[i].string);
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user