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