diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/keyboard.c | 17 | ||||
-rw-r--r-- | src/fe-common/core/module-formats.c | 1 | ||||
-rw-r--r-- | src/fe-common/core/module-formats.h | 1 |
3 files changed, 17 insertions, 2 deletions
diff --git a/src/fe-common/core/keyboard.c b/src/fe-common/core/keyboard.c index d97f5c05..6154cb99 100644 --- a/src/fe-common/core/keyboard.c +++ b/src/fe-common/core/keyboard.c @@ -670,7 +670,7 @@ static void cmd_show_keys(const char *searchkey, int full) printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_BIND_FOOTER); } -/* SYNTAX: BIND [-delete] [<key> [<command> [<data>]]] */ +/* SYNTAX: BIND [-list] [-delete] [<key> [<command> [<data>]]] */ static void cmd_bind(const char *data) { GHashTable *optlist; @@ -682,6 +682,19 @@ static void cmd_bind(const char *data) "bind", &optlist, &key, &id, &keydata)) return; + if (g_hash_table_lookup(optlist, "list")) { + GSList *tmp; + + for (tmp = keyinfos; tmp != NULL; tmp = tmp->next) { + KEYINFO_REC *rec = tmp->data; + + printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_BIND_COMMAND_LIST, + rec->id, rec->description ? rec->description : ""); + } + cmd_params_free(free_arg); + return; + } + if (*key != '\0' && g_hash_table_lookup(optlist, "delete")) { /* delete key */ key_configure_remove(key); @@ -840,7 +853,7 @@ void keyboard_init(void) signal_add("complete command bind", (SIGNAL_FUNC) sig_complete_bind); command_bind("bind", NULL, (SIGNAL_FUNC) cmd_bind); - command_set_options("bind", "delete"); + command_set_options("bind", "delete list"); } void keyboard_deinit(void) diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c index 7c9506e6..10ada9ec 100644 --- a/src/fe-common/core/module-formats.c +++ b/src/fe-common/core/module-formats.c @@ -269,6 +269,7 @@ FORMAT_REC fecommon_core_formats[] = { { "perl_error", "Perl error: $0", 1, { 0 } }, { "bind_header", "%#Key Action", 0 }, { "bind_list", "%#$[!20]0 $1 $2", 3, { 0, 0, 0 } }, + { "bind_command_list", "$[!30]0 $1", 2, { 0, 0 } }, { "bind_footer", "", 0 }, { "bind_unknown_id", "Unknown bind action: $0", 1, { 0 } }, { "config_saved", "Saved configuration to file $0", 1, { 0 } }, diff --git a/src/fe-common/core/module-formats.h b/src/fe-common/core/module-formats.h index bed3be3a..64dde0f9 100644 --- a/src/fe-common/core/module-formats.h +++ b/src/fe-common/core/module-formats.h @@ -234,6 +234,7 @@ enum { TXT_PERL_ERROR, TXT_BIND_HEADER, TXT_BIND_LIST, + TXT_BIND_COMMAND_LIST, TXT_BIND_FOOTER, TXT_BIND_UNKNOWN_ID, TXT_CONFIG_SAVED, |