60 {
"<PageUp>", KEY_PPAGE },
61 {
"<PageDown>", KEY_NPAGE },
63 {
"<Down>", KEY_DOWN },
64 {
"<Right>", KEY_RIGHT },
65 {
"<Left>", KEY_LEFT },
66 {
"<Delete>", KEY_DC },
67 {
"<BackSpace>", KEY_BACKSPACE },
68 {
"<Insert>", KEY_IC },
69 {
"<Home>", KEY_HOME },
74 {
"<KeypadEnter>", KEY_ENTER },
76 {
"<KeypadEnter>",
'\n' },
82 {
"<BackTab>", KEY_BTAB },
85 {
"<Next>", KEY_NEXT },
170 if ((s[0] !=
'<') || (tolower(s[1]) !=
'f'))
173 for (t = s + 2; *t && isdigit((
unsigned char) *t); t++)
194 char *end_char = NULL;
195 long int result = strtol(s + 1, &end_char, 8);
197 while (isspace(*end_char))
200 if ((*end_char !=
'>') || (result < 0) || (result == LONG_MAX))
219 char buf[128] = { 0 };
229 if ((*s ==
'<') && (t = strchr(s,
'>')))
257 *d = (
unsigned char) *s;
278 while (*pos < k1->
len && *pos < k2->
len)
280 if (k1->
keys[*pos] < k2->
keys[*pos])
282 else if (k1->
keys[*pos] > k2->
keys[*pos])
300 for (
int i = 0; funcs[i].
name; i++)
322 for (
int i = 0; funcs[i].
name; i++)
324 if (funcs[i].
op ==
op)
325 return funcs[i].
name;
343 mbstate_t mbstate1 = { 0 };
344 mbstate_t mbstate2 = { 0 };
346 for (; (
len > 0) && (k = mbrtowc(&wc,
macro, MB_LEN_MAX, &mbstate1));
macro += k,
len -= k)
351 memset(&mbstate1, 0,
sizeof(mbstate1));
356 const int w = wcwidth(wc);
359 char tmp[MB_LEN_MAX * 2] = { 0 };
365 else if ((wc < 0x20) || (wc == 0x7f))
393 struct Keymap *map = NULL;
427 max_width =
MAX(max_width, col_width);
442 const struct KeymapList *km_aux,
struct BindingInfoArray *bia_unbound)
444 for (
int i = 0; funcs[i].
name; i++)
446 if (!
is_bound(km_menu, funcs[i].op) &&
447 (!km_aux || !
is_bound(km_aux, funcs[i].op)))
451 bi.
a[1] = funcs[i].
name;
474 if ((c < 256) && (c > -128) && iscntrl((
unsigned char) c))
489 else if ((c >= KEY_F0) && (c < KEY_F(256)))
493 else if ((c < 256) && (c >= -128) &&
IsPrint(c))
514 for (
int i = 0; i < map->
len; i++)
625 struct BindingInfoArray *bia_macro)
630 struct Keymap *map = NULL;
638 if (map->
op == OP_MACRO)
640 if (!bia_macro || (map->
op == OP_NULL))
655 if (map->
op == OP_NULL)
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_SIZE(head)
The number of elements stored.
int buf_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
int binding_sort(const void *a, const void *b, void *sdata)
Compare two BindingInfo by their keybinding - Implements sort_t -.
const struct MenuFuncOp OpGeneric[]
Functions for the Generic Menu.
const struct MenuFuncOp OpDialog[]
Functions for Simple Dialogs.
Convenience wrapper for the gui headers.
const struct MenuFuncOp OpQuery[]
Functions for the external Query Menu.
struct Keymap * km_find_func(enum MenuType mtype, int func)
Find a function's mapping in a Menu.
int parse_fkey(char *s)
Parse a function key string.
keycode_t AbortKey
code of key to abort prompts, normally Ctrl-G
const struct MenuFuncOp OpPostponed[]
Functions for the Postpone Menu.
const struct MenuFuncOp OpIndex[]
Functions for the Index Menu.
int measure_column(struct BindingInfoArray *bia, int col)
Measure one column of a table.
struct Keymap * km_compare_keys(struct Keymap *k1, struct Keymap *k2, size_t *pos)
Compare two keymaps' keyscodes and return the bigger one.
struct Keymap * alloc_keys(size_t len, keycode_t *keys)
Allocate space for a sequence of keys.
void gather_menu(enum MenuType menu, struct BindingInfoArray *bia_bind, struct BindingInfoArray *bia_macro)
Gather info about one menu.
const struct MenuFuncOp OpCompose[]
Functions for the Compose Menu.
const char * help_lookup_function(int op, enum MenuType menu)
Find a keybinding for an operation.
void mutt_keymap_free(struct Keymap **ptr)
Free a Keymap.
const struct MenuFuncOp OpSmime[]
Functions for the Smime Menu.
const struct MenuFuncOp OpBrowser[]
Functions for the file Browser Menu.
const struct MenuFuncOp OpAutocrypt[]
Functions for the Autocrypt Account.
static int parse_keycode(const char *s)
Parse a numeric keycode.
const struct MenuFuncOp OpPager[]
Functions for the Pager Menu.
bool is_bound(const struct KeymapList *km_list, int op)
Does a function have a keybinding?
struct KeymapList Keymaps[MENU_MAX]
Array of key mappings, one for each MenuType.
size_t parsekeys(const char *str, keycode_t *d, size_t max)
Parse a key string into key codes.
const struct MenuFuncOp OpEditor[]
Functions for the Editor Menu.
const char * mutt_get_func(const struct MenuFuncOp *funcs, int op)
Get the name of a function.
const struct MenuFuncOp OpAttachment[]
Functions for the Attachment Menu.
void km_keyname(int c, struct Buffer *buf)
Get the human name for a key.
const struct MenuFuncOp OpPgp[]
Functions for the Pgp Menu.
const struct MenuFuncOp * km_get_table(enum MenuType mtype)
Lookup a Menu's functions.
struct Mapping KeyNames[]
Key name lookup table.
int get_op(const struct MenuFuncOp *funcs, const char *start, size_t len)
Get the function by its name.
void escape_macro(const char *macro, struct Buffer *buf)
Escape any special characters in a macro.
int gather_unbound(const struct MenuFuncOp *funcs, const struct KeymapList *km_menu, const struct KeymapList *km_aux, struct BindingInfoArray *bia_unbound)
Gather info about unbound functions for one menu.
const struct MenuFuncOp OpAlias[]
Functions for the Alias Menu.
bool km_expand_key(struct Keymap *map, struct Buffer *buf)
Get the key string bound to a Keymap.
void km_expand_key_string(char *str, struct Buffer *buf)
Get a human-readable key string.
short keycode_t
Type for key storage, the rest of neomutt works fine with int type.
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
#define MUTT_MEM_CALLOC(n, type)
wchar_t ReplacementChar
When a Unicode character can't be displayed, use this instead.
#define ICONV_BUF_TOO_SMALL
Error value for iconv() - Buffer too small.
#define ICONV_ILLEGAL_SEQ
Error value for iconv() - Illegal sequence.
Convenience wrapper for the library headers.
int mutt_str_cmp(const char *a, const char *b)
Compare two strings, safely.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
bool mutt_istrn_equal(const char *a, const char *b, size_t num)
Check for equality of two strings ignoring case (to a maximum), safely.
const char * opcodes_get_description(int op)
Get the description of an opcode.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
#define STAILQ_FOREACH(var, head, field)
Info about one keybinding.
const char * a[3]
Array of info.
String manipulation buffer.
keycode_t * keys
key sequence
char * macro
Macro expansion (op == OP_MACRO)
char * desc
Description of a macro for the help menu.
short len
Length of key sequence (unit: sizeof (keycode_t))
short op
Operation to perform.
Mapping between user-readable string and a constant.
MenuType
Types of GUI selections.
@ MENU_INDEX
Index panel (list of emails)
@ MENU_DIALOG
Simple Dialog.
@ MENU_QUERY
Select from results of external query.
@ MENU_AUTOCRYPT
Autocrypt Account menu.
@ MENU_COMPOSE
Compose an email.
@ MENU_ATTACHMENT
Select an attachment.
@ MENU_PGP
PGP encryption menu.
@ MENU_GENERIC
Generic selection list.
@ MENU_PAGER
Pager pager (email viewer)
@ MENU_SMIME
SMIME encryption menu.
@ MENU_EDITOR
Text entry area.
@ MENU_ALIAS
Select an email address by its alias.
@ MENU_FOLDER
General file/mailbox browser.
@ MENU_POSTPONED
Select a postponed email.