diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-04-15 16:40:08 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-04-15 16:40:08 +0200 |
commit | dae4068a0e1639f351c89b6b8f97a8036d411228 (patch) | |
tree | b8be49bed2b9ccb9222eb74cabb85dd418c41df9 /src/core | |
parent | 26f55917322c5177efc20c9763ef47fa8e2505ee (diff) | |
download | weechat-dae4068a0e1639f351c89b6b8f97a8036d411228.zip |
Added keys by buffer (useful for buffers with free content that need own keys)
These keys can be set thru API function "buffer_set", for example:
weechat_buffer_set(my_buffer, "key_bind_meta2-A", "/mycommand up");
weechat_buffer_set(my_buffer, "key_bind_meta2-B", "/mycommand down");
weechat_buffer_set(my_buffer, "key_unbind_meta2-B", "");
weechat_buffer_set(my_buffer, "key_unbind_*", "");
These keys are volatile and not saved in any config file. So they must be set
when buffer is open.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-command.c | 8 | ||||
-rw-r--r-- | src/core/wee-config.c | 8 | ||||
-rw-r--r-- | src/core/wee-debug.c | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 6991c901d..8cdd56928 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -1155,7 +1155,7 @@ command_key (void *data, struct t_gui_buffer *buffer, { if ((argc >= 3) && (string_strcasecmp (argv[2], "-yes") == 0)) { - gui_keyboard_free_all (); + gui_keyboard_free_all (&gui_keys, &last_gui_key); gui_keyboard_init (); gui_chat_printf (NULL, _("Default key bindings restored")); @@ -1176,7 +1176,7 @@ command_key (void *data, struct t_gui_buffer *buffer, { if (argc >= 3) { - if (gui_keyboard_unbind (argv[2])) + if (gui_keyboard_unbind (NULL, argv[2])) { gui_chat_printf (NULL, _("Key \"%s\" unbound"), @@ -1230,7 +1230,7 @@ command_key (void *data, struct t_gui_buffer *buffer, ptr_key = NULL; internal_code = gui_keyboard_get_internal_code (argv[1]); if (internal_code) - ptr_key = gui_keyboard_search (internal_code); + ptr_key = gui_keyboard_search (NULL, internal_code); if (ptr_key) { gui_chat_printf (NULL, ""); @@ -1248,7 +1248,7 @@ command_key (void *data, struct t_gui_buffer *buffer, } /* bind new key */ - ptr_key = gui_keyboard_bind (argv[1], argv_eol[2]); + ptr_key = gui_keyboard_bind (NULL, argv[1], argv_eol[2]); if (ptr_key) { command_key_display (ptr_key, 1); diff --git a/src/core/wee-config.c b/src/core/wee-config.c index a37a28614..6a48ccaa1 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -508,7 +508,7 @@ config_weechat_reload (void *data, struct t_config_file *config_file) (void) config_file; /* remove all keys */ - gui_keyboard_free_all (); + gui_keyboard_free_all (&gui_keys, &last_gui_key); /* remove all bars */ gui_bar_free_all (); @@ -589,8 +589,6 @@ config_weechat_bar_read (void *data, struct t_config_file *config_file, value); if (ptr_option) { - log_printf ("createion pour index %d, ptr = %x", - index_option, ptr_temp_bar); switch (index_option) { case GUI_BAR_OPTION_TYPE: @@ -739,12 +737,12 @@ config_weechat_key_read (void *data, struct t_config_file *config_file, if (value && value[0]) { /* bind key (overwrite any binding with same key) */ - gui_keyboard_bind (option_name, value); + gui_keyboard_bind (NULL, option_name, value); } else { /* unbind key if no value given */ - gui_keyboard_unbind (option_name); + gui_keyboard_unbind (NULL, option_name); } } diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c index 746d73c8e..e3094c476 100644 --- a/src/core/wee-debug.c +++ b/src/core/wee-debug.c @@ -37,6 +37,7 @@ #include "../gui/gui-chat.h" #include "../gui/gui-filter.h" #include "../gui/gui-hotlist.h" +#include "../gui/gui-keyboard.h" #include "../gui/gui-main.h" #include "../gui/gui-window.h" #include "../plugins/plugin.h" @@ -76,6 +77,7 @@ debug_dump (int crash) gui_window_print_log (); gui_buffer_print_log (); + gui_keyboard_print_log (NULL); gui_filter_print_log (); gui_bar_print_log (); gui_bar_item_print_log (); |