summaryrefslogtreecommitdiffstats
path: root/keymap.h
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-07-25 14:45:56 -0700
committerKevin McCarthy <kevin@8t8.us>2021-07-28 15:02:11 -0700
commit4021ab59f021abd84742ae36895158c7129cbb38 (patch)
treed2a4baa2debdffcfe49de40237ec52f8969c49c2 /keymap.h
parentf4ff768c2764502a974042e1fe9d861a7a92fbcf (diff)
Break the menu OPS/funcs and keybindings into separate tables.
Move the "extra" keybindings added manually inside km_init() into the keybinding tables instead. This allows the documentation in the manual to be generated correctly. It also corrects a small problem with duplicate OPS in the struct binding_t table. The exec completion and unbound list in the help menu iterated the active binding_t table and assumed each OP appears only once. When '\n' and '\r' were both added to the binding_t table, this broke the assumption and caused those to misbehave.
Diffstat (limited to 'keymap.h')
-rw-r--r--keymap.h41
1 files changed, 24 insertions, 17 deletions
diff --git a/keymap.h b/keymap.h
index 722542c4..bc83020f 100644
--- a/keymap.h
+++ b/keymap.h
@@ -94,36 +94,43 @@ extern int LastKey;
extern const struct mapping_t Menus[];
-struct binding_t
+/* The function-op pairs available in a menu */
+struct menu_func_op_t
{
char *name; /* name of the function */
int op; /* function id number */
- char *seq; /* default key binding */
};
-const struct binding_t *km_get_table (int menu);
+/* The default bound key sequences in a menu */
+struct menu_op_seq_t
+{
+ int op;
+ char *seq; /* default key binding */
+};
+
+const struct menu_func_op_t *km_get_table (int menu);
-extern const struct binding_t OpGeneric[];
-extern const struct binding_t OpPost[];
-extern const struct binding_t OpMain[];
-extern const struct binding_t OpAttach[];
-extern const struct binding_t OpPager[];
-extern const struct binding_t OpCompose[];
-extern const struct binding_t OpBrowser[];
-extern const struct binding_t OpEditor[];
-extern const struct binding_t OpQuery[];
-extern const struct binding_t OpAlias[];
+extern const struct menu_func_op_t OpGeneric[];
+extern const struct menu_func_op_t OpPost[];
+extern const struct menu_func_op_t OpMain[];
+extern const struct menu_func_op_t OpAttach[];
+extern const struct menu_func_op_t OpPager[];
+extern const struct menu_func_op_t OpCompose[];
+extern const struct menu_func_op_t OpBrowser[];
+extern const struct menu_func_op_t OpEditor[];
+extern const struct menu_func_op_t OpQuery[];
+extern const struct menu_func_op_t OpAlias[];
-extern const struct binding_t OpPgp[];
+extern const struct menu_func_op_t OpPgp[];
-extern const struct binding_t OpSmime[];
+extern const struct menu_func_op_t OpSmime[];
#ifdef MIXMASTER
-extern const struct binding_t OpMix[];
+extern const struct menu_func_op_t OpMix[];
#endif
#ifdef USE_AUTOCRYPT
-extern const struct binding_t OpAutocryptAcct[];
+extern const struct menu_func_op_t OpAutocryptAcct[];
#endif
#include "keymap_defs.h"