summaryrefslogtreecommitdiffstats
path: root/key-string.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2010-01-17 19:01:27 +0000
committerTiago Cunha <tcunha@gmx.com>2010-01-17 19:01:27 +0000
commit2a2e24a17769b5b33b809d01122cc9a0cd465263 (patch)
treea3366716de26cfa3a54b969949db6a7ec1bd7737 /key-string.c
parentdfc2ad1e5f7457f757a120e98fb397f10895059f (diff)
Sync OpenBSD patchset 608:
Permit S- prefix on keys for shift. Relatively few terminals support this (basically xterm only) and even fewer have them in terminfo (kLFT2 and kRIT2).
Diffstat (limited to 'key-string.c')
-rw-r--r--key-string.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/key-string.c b/key-string.c
index 4ee1d509..e8f20ec4 100644
--- a/key-string.c
+++ b/key-string.c
@@ -1,4 +1,4 @@
-/* $Id: key-string.c,v 1.28 2009-12-04 22:14:47 tcunha Exp $ */
+/* $Id: key-string.c,v 1.29 2010-01-17 19:01:27 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -170,6 +170,25 @@ key_string_lookup_string(const char *string)
return (KEYC_NONE);
}
+ if ((string[0] == 'S' || string[0] == 's') && string[1] == '-') {
+ ptr = string + 2;
+ if (ptr[0] == '\0')
+ return (KEYC_NONE);
+ key = key_string_lookup_string(ptr);
+ if (key != KEYC_NONE) {
+ if (key >= KEYC_BASE)
+ return (key | KEYC_SHIFT);
+ } else {
+ if (ptr[1] == '\0')
+ return (KEYC_NONE);
+ key = (u_char) ptr[0];
+ }
+
+ if (key >= 32 && key <= 127)
+ return (key | KEYC_SHIFT);
+ return (KEYC_NONE);
+ }
+
return (key_string_search_table(string));
}