2 b7d58e0b 2021-11-05 op * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
4 b7d58e0b 2021-11-05 op * Permission to use, copy, modify, and distribute this software for any
5 b7d58e0b 2021-11-05 op * purpose with or without fee is hereby granted, provided that the above
6 b7d58e0b 2021-11-05 op * copyright notice and this permission notice appear in all copies.
8 b7d58e0b 2021-11-05 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 b7d58e0b 2021-11-05 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 b7d58e0b 2021-11-05 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 b7d58e0b 2021-11-05 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 b7d58e0b 2021-11-05 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 b7d58e0b 2021-11-05 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 b7d58e0b 2021-11-05 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 b7d58e0b 2021-11-05 op #ifndef KEYMAP_H
18 b7d58e0b 2021-11-05 op #define KEYMAP_H
20 b7d58e0b 2021-11-05 op #include "compat.h"
22 b7d58e0b 2021-11-05 op #include <stdint.h>
24 b7d58e0b 2021-11-05 op struct buffer;
27 b7d58e0b 2021-11-05 op TAILQ_HEAD(map, keymap) m;
28 b7d58e0b 2021-11-05 op void (*unhandled_input)(void);
30 b7d58e0b 2021-11-05 op extern struct kmap global_map, minibuffer_map;
32 b7d58e0b 2021-11-05 op typedef void(interactivefn)(struct buffer *);
34 b7d58e0b 2021-11-05 op struct keymap {
37 b7d58e0b 2021-11-05 op struct kmap map;
38 b7d58e0b 2021-11-05 op interactivefn *fn;
40 b7d58e0b 2021-11-05 op TAILQ_ENTRY(keymap) keymaps;
43 b7d58e0b 2021-11-05 op struct thiskey {
50 b7d58e0b 2021-11-05 op LK_ADVANCED_MAP,
55 b7d58e0b 2021-11-05 op int kbd(const char *);
56 b7d58e0b 2021-11-05 op const char *unkbd(int);
57 b7d58e0b 2021-11-05 op int kmap_define_key(struct kmap *, const char *, interactivefn *);
58 b7d58e0b 2021-11-05 op int lookup_key(struct kmap **, struct thiskey *, struct buffer *);