diff options
author | Timo Sirainen <cras@irssi.org> | 2001-09-11 18:15:17 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-09-11 18:15:17 +0000 |
commit | 3432f02a05cfc369bd1f3430bcf04bc3d3ce0f6e (patch) | |
tree | ddb0fcbf184a564cc16a9acf428d6760a532de6e /src | |
parent | f4fdd568904320e764168c9b1501268206998609 (diff) | |
download | irssi-3432f02a05cfc369bd1f3430bcf04bc3d3ce0f6e.zip |
It's now possible to stop single character /BINDs from printing to input
line. Hiascii characters didn't work properly with /BIND.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1792 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/keyboard.c | 11 | ||||
-rw-r--r-- | src/fe-text/gui-readline.c | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/fe-common/core/keyboard.c b/src/fe-common/core/keyboard.c index 01dd43c9..f69edacc 100644 --- a/src/fe-common/core/keyboard.c +++ b/src/fe-common/core/keyboard.c @@ -524,7 +524,8 @@ static int key_emit_signal(KEYBOARD_REC *keyboard, KEY_REC *key) return consumed; } -static int key_states_search(const char *combo, const char *search) +static int key_states_search(const unsigned char *combo, + const unsigned char *search) { while (*search != '\0') { if (*combo != *search) @@ -541,13 +542,13 @@ int key_pressed(KEYBOARD_REC *keyboard, const char *key) { KEY_REC *rec; char *combo; - int consumed, single_key; + int consumed; g_return_val_if_fail(keyboard != NULL, FALSE); g_return_val_if_fail(key != NULL && *key != '\0', FALSE); - single_key = keyboard->key_state == NULL && key[1] == '\0'; - if (single_key && !used_keys[(int) (unsigned char) key[0]]) { + if (keyboard->key_state == NULL && key[1] == '\0' && + !used_keys[(int) (unsigned char) key[0]]) { /* fast check - key not used */ return FALSE; } @@ -576,7 +577,7 @@ int key_pressed(KEYBOARD_REC *keyboard, const char *key) consumed = key_emit_signal(keyboard, rec); /* never consume non-control characters */ - return consumed && !single_key; + return consumed; } void keyboard_entry_redirect(SIGNAL_FUNC func, const char *entry, diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c index c28daed1..c44be58f 100644 --- a/src/fe-text/gui-readline.c +++ b/src/fe-text/gui-readline.c @@ -505,6 +505,7 @@ void gui_readline_init(void) keyboard = keyboard_create(NULL); key_configure_freeze(); + key_bind("key", NULL, " ", "space", (SIGNAL_FUNC) key_combo); key_bind("key", NULL, "^M", "return", (SIGNAL_FUNC) key_combo); key_bind("key", NULL, "^J", "return", (SIGNAL_FUNC) key_combo); @@ -567,8 +568,7 @@ void gui_readline_init(void) /* line transmitting */ key_bind("send_line", "Execute the input line", "return", NULL, (SIGNAL_FUNC) key_send_line); key_bind("word_completion", "", "^I", NULL, (SIGNAL_FUNC) key_word_completion); - key_bind("check_replaces", "Check word replaces", " ", NULL, (SIGNAL_FUNC) key_check_replaces); - key_bind("check_replaces", NULL, NULL, NULL, (SIGNAL_FUNC) key_check_replaces); + key_bind("check_replaces", "Check word replaces", NULL, NULL, (SIGNAL_FUNC) key_check_replaces); /* window managing */ key_bind("previous_window", "Previous window", "^P", NULL, (SIGNAL_FUNC) key_previous_window); @@ -593,6 +593,7 @@ void gui_readline_init(void) key_bind("insert_text", "Append text to line", NULL, NULL, (SIGNAL_FUNC) key_insert_text); key_bind("multi", NULL, "return", "check_replaces;send_line", NULL); + key_bind("multi", NULL, "space", "check_replaces;insert_text ", NULL); for (n = 0; changekeys[n] != '\0'; n++) { key = g_strdup_printf("meta-%c", changekeys[n]); |