1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-06 04:53:38 -04:00

/BIND works a bit better again when parsing the given key.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2110 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-11-19 23:56:00 +00:00 committed by cras
parent 44565932e3
commit 0fc752528f

View File

@ -265,8 +265,7 @@ static int expand_key(const char *key, GSList **out)
start = NULL; last_hyphen = TRUE;
for (; *key != '\0'; key++) {
if (start != NULL) {
if (!isdigit(*start) &&
(isalnum(*key) || *key == '_')) {
if (isalnum(*key) || *key == '_') {
/* key combo continues */
continue;
}
@ -292,11 +291,14 @@ static int expand_key(const char *key, GSList **out)
expand_out_char(*out, *key);
expand_out_char(*out, '-');
last_hyphen = FALSE; /* optional */
} else {
/* key / combo */
} else if (last_hyphen && isalnum(*key) && !isdigit(*key)) {
/* possibly beginning of keycombo */
start = key;
last_hyphen = FALSE;
continue;
} else {
expand_out_char(*out, *key);
expand_out_char(*out, '-');
last_hyphen = FALSE; /* optional */
}
}
@ -798,6 +800,10 @@ static void read_keyboard_config(void)
void keyboard_init(void)
{
GSList *l;
l = NULL;
expand_key("^[[5D", &l);
keys = g_hash_table_new((GHashFunc) g_str_hash,
(GCompareFunc) g_str_equal);
default_keys = g_hash_table_new((GHashFunc) g_str_hash,