summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-05-16 00:47:14 +0200
committerSebastien Helleu <flashcode@flashtux.org>2009-05-16 00:47:14 +0200
commit947ae241ceea9a665a3b667aaf6e5449bbe63aa5 (patch)
tree67352aeff8d75516238bac90453bf928a11a883b /src/plugins
parent041b754980c0c11474396c52f7ac3fc0d10abef6 (diff)
downloadweechat-947ae241ceea9a665a3b667aaf6e5449bbe63aa5.zip
Add infolist "key" with key bindings
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/plugin-api.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c
index fb4483b26..a9028e356 100644
--- a/src/plugins/plugin-api.c
+++ b/src/plugins/plugin-api.c
@@ -316,6 +316,7 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name,
struct t_gui_filter *ptr_filter;
struct t_gui_window *ptr_window;
struct t_gui_hotlist *ptr_hotlist;
+ struct t_gui_key *ptr_key;
struct t_weechat_plugin *ptr_plugin;
char buffer_full_name[1024];
@@ -574,6 +575,22 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name,
return ptr_infolist;
}
}
+ else if (string_strcasecmp (infolist_name, "key") == 0)
+ {
+ ptr_infolist = infolist_new ();
+ if (ptr_infolist)
+ {
+ for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
+ {
+ if (!gui_keyboard_add_to_infolist (ptr_infolist, ptr_key))
+ {
+ infolist_free (ptr_infolist);
+ return NULL;
+ }
+ }
+ return ptr_infolist;
+ }
+ }
else if (string_strcasecmp (infolist_name, "nicklist") == 0)
{
/* invalid buffer pointer ? */
@@ -883,6 +900,8 @@ plugin_api_init ()
&plugin_api_infolist_get_internal, NULL);
hook_infolist (NULL, "hotlist", N_("list of buffers in hotlist"),
&plugin_api_infolist_get_internal, NULL);
+ hook_infolist (NULL, "key", N_("list of key bindings"),
+ &plugin_api_infolist_get_internal, NULL);
hook_infolist (NULL, "nicklist", N_("nicks in nicklist for a buffer"),
&plugin_api_infolist_get_internal, NULL);
hook_infolist (NULL, "option", N_("list of options"),