diff options
author | Timo Sirainen <cras@irssi.org> | 2001-05-08 18:05:53 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-05-08 18:05:53 +0000 |
commit | 4c8ad5a4c5f50ec1b1baafbd9d9e676f75accc14 (patch) | |
tree | e6d311f17114e268e947058e052b4bcf9411edaf /src | |
parent | 79b908c41cbfbdf6191720a7dbc1dd5dfea7e458 (diff) | |
download | irssi-4c8ad5a4c5f50ec1b1baafbd9d9e676f75accc14.zip |
some fixes, saving is still broken
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1464 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/keyboard.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/fe-common/core/keyboard.c b/src/fe-common/core/keyboard.c index 7754feae..72094f07 100644 --- a/src/fe-common/core/keyboard.c +++ b/src/fe-common/core/keyboard.c @@ -147,20 +147,15 @@ static void keyconfig_save(const char *id, const char *key, const char *data) iconfig_node_set_str(node, "data", data); } -static void keyconfig_clear(const char *id, const char *key) +static void keyconfig_clear(const char *key) { CONFIG_NODE *node; - g_return_if_fail(id != NULL); + g_return_if_fail(key != NULL); /* remove old keyboard settings */ node = iconfig_node_traverse("keyboard", TRUE); - if (key == NULL) - iconfig_node_set_str(node, id, NULL); - else { - node = config_node_section(node, id, -1); - if (node != NULL) iconfig_node_set_str(node, key, NULL); - } + iconfig_node_set_str(node, key, NULL); } KEYINFO_REC *key_info_find(const char *id) @@ -411,7 +406,7 @@ void key_configure_remove(const char *key) rec = g_hash_table_lookup(keys, key); if (rec == NULL) return; - keyconfig_clear(rec->info->id, key); + keyconfig_clear(key); key_configure_destroy(rec); } @@ -453,7 +448,9 @@ int key_pressed(KEYBOARD_REC *keyboard, const char *key) rec = g_tree_search(key_states, (GSearchFunc) key_states_search, (void *) key); - if (rec == NULL || strcmp(rec->info->id, "key") != 0) { + if (rec == NULL || + (g_tree_lookup(key_states, (void *) key) != NULL && + strcmp(rec->info->id, "key") != 0)) { /* a single non-combo key was pressed */ rec = g_hash_table_lookup(keys, key); if (rec == NULL) |