mirror of
https://github.com/tmate-io/tmate.git
synced 2025-01-24 06:49:03 +01:00
Allow C-Space to work correctly once again, and forbid nonsensical combinations such as C-Enter or C-Escape.
This commit is contained in:
parent
e334deb872
commit
d27956f160
17
key-string.c
17
key-string.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: key-string.c,v 1.32 2010-05-14 14:21:07 tcunha Exp $ */
|
/* $Id: key-string.c,v 1.33 2010-06-05 06:27:19 micahcowan Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -149,9 +149,15 @@ key_string_lookup_string(const char *string)
|
|||||||
key = (u_char) string[0];
|
key = (u_char) string[0];
|
||||||
if (key < 32 || key > 126)
|
if (key < 32 || key > 126)
|
||||||
return (KEYC_NONE);
|
return (KEYC_NONE);
|
||||||
|
} else {
|
||||||
|
/* Otherwise look the key up in the table. */
|
||||||
|
key = key_string_search_table(string);
|
||||||
|
if (key == KEYC_NONE)
|
||||||
|
return (KEYC_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
/* Convert the standard control keys. */
|
/* Convert the standard control keys. */
|
||||||
if (modifiers & KEYC_CTRL) {
|
if (key < KEYC_BASE && (modifiers & KEYC_CTRL)) {
|
||||||
if (key >= 97 && key <= 122)
|
if (key >= 97 && key <= 122)
|
||||||
key -= 96;
|
key -= 96;
|
||||||
else if (key >= 64 && key <= 95)
|
else if (key >= 64 && key <= 95)
|
||||||
@ -168,13 +174,6 @@ key_string_lookup_string(const char *string)
|
|||||||
return (key | modifiers);
|
return (key | modifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Otherwise look the key up in the table. */
|
|
||||||
key = key_string_search_table(string);
|
|
||||||
if (key == KEYC_NONE)
|
|
||||||
return (KEYC_NONE);
|
|
||||||
return (key | modifiers);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Convert a key code into string format, with prefix if necessary. */
|
/* Convert a key code into string format, with prefix if necessary. */
|
||||||
const char *
|
const char *
|
||||||
key_string_lookup_key(int key)
|
key_string_lookup_key(int key)
|
||||||
|
Loading…
Reference in New Issue
Block a user