mirror of https://github.com/tmux/tmux.git
Allow top-bit-set characters to be used for key bindings, from Tiago
Cunha.pull/1/head
parent
b8023044c3
commit
3872e24847
|
@ -147,7 +147,7 @@ key_string_lookup_string(const char *string)
|
|||
/* Is this a standard ASCII key? */
|
||||
if (string[1] == '\0') {
|
||||
key = (u_char) string[0];
|
||||
if (key < 32 || key > 126)
|
||||
if (key < 32 || key == 127 || key > 255)
|
||||
return (KEYC_NONE);
|
||||
} else {
|
||||
/* Otherwise look the key up in the table. */
|
||||
|
@ -213,7 +213,7 @@ key_string_lookup_key(int key)
|
|||
}
|
||||
|
||||
/* Invalid keys are errors. */
|
||||
if (key >= 127)
|
||||
if (key == 127 || key > 255)
|
||||
return (NULL);
|
||||
|
||||
/* Check for standard or control key. */
|
||||
|
@ -225,7 +225,9 @@ key_string_lookup_key(int key)
|
|||
} else if (key >= 32 && key <= 126) {
|
||||
tmp[0] = key;
|
||||
tmp[1] = '\0';
|
||||
}
|
||||
} else if (key >= 128)
|
||||
xsnprintf(tmp, sizeof tmp, "\\%o", key);
|
||||
|
||||
strlcat(out, tmp, sizeof out);
|
||||
return (out);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue