diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-07-28 09:18:01 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-07-28 09:18:01 +0000 |
commit | 9e5d585ba4b0af6badf559cc7b275a23be8947c2 (patch) | |
tree | d20cc67dbd6e255042ee853472ff70746596b9e0 | |
parent | 86785004baf4086816b5d6684b9d0e4c56b58ea6 (diff) | |
download | rtmux-9e5d585ba4b0af6badf559cc7b275a23be8947c2.tar.gz rtmux-9e5d585ba4b0af6badf559cc7b275a23be8947c2.tar.bz2 rtmux-9e5d585ba4b0af6badf559cc7b275a23be8947c2.zip |
Accept and print "Enter" and "Escape" for keys rather than C-m and C-[.
-rw-r--r-- | key-string.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/key-string.c b/key-string.c index 5c8ce5b3..68a57f8b 100644 --- a/key-string.c +++ b/key-string.c @@ -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); } |