diff options
author | Alexander Færøy <ahf@0x90.dk> | 2015-02-16 22:15:04 +0100 |
---|---|---|
committer | Alexander Færøy <ahf@0x90.dk> | 2015-02-16 22:15:04 +0100 |
commit | 8e64aee42a0692360ef108b11aa035fdd04b0a89 (patch) | |
tree | 00bf87bc28af6afcd67b6bfa454169cebdf26c1b /src/fe-common/core | |
parent | dd58bd5f7b616dbdd927d7828205b8635d3f76f9 (diff) | |
parent | 09f23d06b5262c53b65fa04d4f83cfd170d919c5 (diff) | |
download | irssi-8e64aee42a0692360ef108b11aa035fdd04b0a89.zip |
Merge pull request #115 from ailin-nemui/fix-hat-key
Make ^ key and Ctrl+^ key usable with /BIND
Diffstat (limited to 'src/fe-common/core')
-rw-r--r-- | src/fe-common/core/keyboard.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/fe-common/core/keyboard.c b/src/fe-common/core/keyboard.c index 00454401..bec1502e 100644 --- a/src/fe-common/core/keyboard.c +++ b/src/fe-common/core/keyboard.c @@ -292,12 +292,18 @@ static int expand_key(const char *key, GSList **out) } last_hyphen = !last_hyphen; } else if (*key == '^') { + expand_out_char(*out, '^'); + /* ctrl-code */ - if (key[1] != '\0') + 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, *key); expand_out_char(*out, '-'); last_hyphen = FALSE; /* optional */ } else if (last_hyphen && i_isalpha(*key)) { |