forked from PsychoticNinja/irssi
Merge pull request #115 from ailin-nemui/fix-hat-key
Make ^ key and Ctrl+^ key usable with /BIND
This commit is contained in:
commit
8e64aee42a
@ -292,12 +292,18 @@ static int expand_key(const char *key, GSList **out)
|
|||||||
}
|
}
|
||||||
last_hyphen = !last_hyphen;
|
last_hyphen = !last_hyphen;
|
||||||
} else if (*key == '^') {
|
} else if (*key == '^') {
|
||||||
/* ctrl-code */
|
|
||||||
if (key[1] != '\0')
|
|
||||||
key++;
|
|
||||||
|
|
||||||
expand_out_char(*out, '^');
|
expand_out_char(*out, '^');
|
||||||
expand_out_char(*out, *key);
|
|
||||||
|
/* ctrl-code */
|
||||||
|
if (key[1] != '\0' && key[1] != '-') {
|
||||||
|
key++;
|
||||||
|
expand_out_char(*out, *key);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* escaped syntax for ^, see gui-readline.c */
|
||||||
|
expand_out_char(*out, '-');
|
||||||
|
}
|
||||||
|
|
||||||
expand_out_char(*out, '-');
|
expand_out_char(*out, '-');
|
||||||
last_hyphen = FALSE; /* optional */
|
last_hyphen = FALSE; /* optional */
|
||||||
} else if (last_hyphen && i_isalpha(*key)) {
|
} else if (last_hyphen && i_isalpha(*key)) {
|
||||||
|
@ -393,8 +393,8 @@ static void sig_gui_key_pressed(gpointer keyp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(str, "^") == 0) {
|
if (strcmp(str, "^") == 0) {
|
||||||
/* change it as ^^ */
|
/* change it as ^-, that is an invalid control char */
|
||||||
str[1] = '^';
|
str[1] = '-';
|
||||||
str[2] = '\0';
|
str[2] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user