summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-02-01 13:56:50 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-02-01 13:56:50 +0000
commit9cc6acc9a2baa643e8a7e68176d6caa3ff8b60f4 (patch)
treedde2a9d8450697d55074164950730d29323dc94b /src
parent4f5f17e94ade52e8c7edb94d1333c2183d6a6b7a (diff)
downloadirssi-9cc6acc9a2baa643e8a7e68176d6caa3ff8b60f4.zip
Don't eat unknown keys that aren't combinations
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2363 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/core/keyboard.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fe-common/core/keyboard.c b/src/fe-common/core/keyboard.c
index 39d7ee18..b3619bba 100644
--- a/src/fe-common/core/keyboard.c
+++ b/src/fe-common/core/keyboard.c
@@ -546,7 +546,7 @@ int key_pressed(KEYBOARD_REC *keyboard, const char *key)
{
KEY_REC *rec;
char *combo;
- int consumed;
+ int first_key, consumed;
g_return_val_if_fail(keyboard != NULL, FALSE);
g_return_val_if_fail(key != NULL && *key != '\0', FALSE);
@@ -557,6 +557,7 @@ int key_pressed(KEYBOARD_REC *keyboard, const char *key)
return FALSE;
}
+ first_key = keyboard->key_state == NULL;
combo = keyboard->key_state == NULL ? g_strdup(key) :
g_strconcat(keyboard->key_state, "-", key, NULL);
g_free_and_null(keyboard->key_state);
@@ -565,9 +566,10 @@ int key_pressed(KEYBOARD_REC *keyboard, const char *key)
(GSearchFunc) key_states_search,
combo);
if (rec == NULL) {
- /* unknown key combo, eat the invalid key */
+ /* unknown key combo, eat the invalid key
+ unless it was the first key pressed */
g_free(combo);
- return TRUE;
+ return !first_key;
}
if (g_tree_lookup(key_states, combo) != rec) {