From 4ee8b929b99af928d2f66bb1bf62fa0188ce1eff Mon Sep 17 00:00:00 2001
From: Timo Sirainen <cras@irssi.org>
Date: Sun, 22 Oct 2000 15:00:52 +0000
Subject: [PATCH] Key bindings weren't loaded at startup correctly.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@779 dbcabf3a-b0e7-0310-adc4-f8d773084564
---
 src/fe-common/core/keyboard.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/fe-common/core/keyboard.c b/src/fe-common/core/keyboard.c
index da3718d2..80704db9 100644
--- a/src/fe-common/core/keyboard.c
+++ b/src/fe-common/core/keyboard.c
@@ -392,7 +392,8 @@ void keyboard_init(void)
 
 	key_bind("command", "Run any IRC command", NULL, NULL, (SIGNAL_FUNC) sig_command);
 
-	read_keyboard_config();
+	/* read the keyboard config when all key binds are known */
+	signal_add("irssi init read settings", (SIGNAL_FUNC) read_keyboard_config);
 	signal_add("setup reread", (SIGNAL_FUNC) read_keyboard_config);
 	signal_add("complete command bind", (SIGNAL_FUNC) sig_complete_bind);
 
@@ -406,6 +407,7 @@ void keyboard_deinit(void)
 		keyinfo_remove(keyinfos->data);
 	g_hash_table_destroy(keys);
 
+	signal_remove("irssi init read settings", (SIGNAL_FUNC) read_keyboard_config);
         signal_remove("setup reread", (SIGNAL_FUNC) read_keyboard_config);
 	signal_remove("complete command bind", (SIGNAL_FUNC) sig_complete_bind);
 	command_unbind("bind", (SIGNAL_FUNC) cmd_bind);