summaryrefslogtreecommitdiffstats
path: root/keymap.h
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-06-08 09:16:03 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-06-08 09:16:03 +0000
commit1a5381e07e97fe482c2b3a7c75f99938f0b105d4 (patch)
treeb4fa4088bbbf5fc9217ee6f87ab60034175e6899 /keymap.h
Initial revision
Diffstat (limited to 'keymap.h')
-rw-r--r--keymap.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/keymap.h b/keymap.h
new file mode 100644
index 00000000..580bc2ba
--- /dev/null
+++ b/keymap.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 1996-8 Michael R. Elkins <me@cs.hmc.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef KEYMAP_H
+#define KEYMAP_H
+
+/* maximal length of a key binding sequence used for buffer in km_bindkey */
+#define MAX_SEQ 8
+
+/* type for key storage, the rest of mutt works fine with int type */
+typedef short keycode_t;
+
+void km_bindkey (char *, int, int, char *);
+int km_dokey (int);
+
+/* entry in the keymap tree */
+struct keymap_t
+{
+ char *macro; /* macro expansion (op == OP_MACRO) */
+ struct keymap_t *next; /* next key in map */
+ short op; /* operation to perform */
+ short eq; /* number of leading keys equal to next entry */
+ short len; /* length of key sequence (unit: sizeof (keycode_t)) */
+ keycode_t *keys; /* key sequence */
+};
+
+char *km_keyname (int);
+int km_expand_key (char *, size_t, struct keymap_t *);
+struct keymap_t *km_find_func (int, int);
+void km_init (void);
+void km_error_key (int);
+
+enum
+{
+ MENU_ALIAS,
+ MENU_ATTACH,
+ MENU_COMPOSE,
+ MENU_EDITOR,
+ MENU_FOLDER,
+ MENU_GENERIC,
+ MENU_MAIN,
+ MENU_PAGER,
+ MENU_POST,
+
+#ifdef _PGPPATH
+ MENU_PGP,
+#endif
+
+
+
+
+
+ MENU_QUERY,
+ MENU_MAX
+};
+
+/* the keymap trees (one for each menu) */
+extern struct keymap_t *Keymaps[];
+
+/* dokey() records the last real key pressed */
+extern int LastKey;
+
+extern struct mapping_t Menus[];
+
+struct binding_t
+{
+ char *name; /* name of the function */
+ int op; /* function id number */
+ char *seq; /* default key binding */
+};
+
+struct binding_t *km_get_table (int menu);
+
+extern struct binding_t OpGeneric[];
+extern struct binding_t OpPost[];
+extern struct binding_t OpMain[];
+extern struct binding_t OpAttach[];
+extern struct binding_t OpPager[];
+extern struct binding_t OpCompose[];
+extern struct binding_t OpBrowser[];
+extern struct binding_t OpEditor[];
+extern struct binding_t OpQuery[];
+
+#ifdef _PGPPATH
+extern struct binding_t OpPgp[];
+#endif /* _PGPPATH */
+
+#include "keymap_defs.h"
+
+#endif /* KEYMAP_H */