mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -05: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:
parent
44565932e3
commit
0fc752528f
@ -265,8 +265,7 @@ static int expand_key(const char *key, GSList **out)
|
|||||||
start = NULL; last_hyphen = TRUE;
|
start = NULL; last_hyphen = TRUE;
|
||||||
for (; *key != '\0'; key++) {
|
for (; *key != '\0'; key++) {
|
||||||
if (start != NULL) {
|
if (start != NULL) {
|
||||||
if (!isdigit(*start) &&
|
if (isalnum(*key) || *key == '_') {
|
||||||
(isalnum(*key) || *key == '_')) {
|
|
||||||
/* key combo continues */
|
/* key combo continues */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -292,11 +291,14 @@ static int expand_key(const char *key, GSList **out)
|
|||||||
expand_out_char(*out, *key);
|
expand_out_char(*out, *key);
|
||||||
expand_out_char(*out, '-');
|
expand_out_char(*out, '-');
|
||||||
last_hyphen = FALSE; /* optional */
|
last_hyphen = FALSE; /* optional */
|
||||||
} else {
|
} else if (last_hyphen && isalnum(*key) && !isdigit(*key)) {
|
||||||
/* key / combo */
|
/* possibly beginning of keycombo */
|
||||||
start = key;
|
start = key;
|
||||||
last_hyphen = FALSE;
|
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)
|
void keyboard_init(void)
|
||||||
{
|
{
|
||||||
|
GSList *l;
|
||||||
|
|
||||||
|
l = NULL;
|
||||||
|
expand_key("^[[5D", &l);
|
||||||
keys = g_hash_table_new((GHashFunc) g_str_hash,
|
keys = g_hash_table_new((GHashFunc) g_str_hash,
|
||||||
(GCompareFunc) g_str_equal);
|
(GCompareFunc) g_str_equal);
|
||||||
default_keys = g_hash_table_new((GHashFunc) g_str_hash,
|
default_keys = g_hash_table_new((GHashFunc) g_str_hash,
|
||||||
|
Loading…
Reference in New Issue
Block a user