61 {
"<PageUp>", KEY_PPAGE },
62 {
"<PageDown>", KEY_NPAGE },
64 {
"<Down>", KEY_DOWN },
65 {
"<Right>", KEY_RIGHT },
66 {
"<Left>", KEY_LEFT },
67 {
"<Delete>", KEY_DC },
68 {
"<BackSpace>", KEY_BACKSPACE },
69 {
"<Insert>", KEY_IC },
70 {
"<Home>", KEY_HOME },
75 {
"<KeypadEnter>", KEY_ENTER },
77 {
"<KeypadEnter>",
'\n' },
83 {
"<BackTab>", KEY_BTAB },
86 {
"<Next>", KEY_NEXT },
171 if ((s[0] !=
'<') || (tolower(s[1]) !=
'f'))
174 for (t = s + 2; *t && isdigit((
unsigned char) *t); t++)
195 char *end_char = NULL;
196 long int result = strtol(s + 1, &end_char, 8);
198 while (isspace(*end_char))
201 if ((*end_char !=
'>') || (result < 0) || (result == LONG_MAX))
220 char buf[128] = { 0 };
230 if ((*s ==
'<') && (t = strchr(s,
'>')))
258 *d = (
unsigned char) *s;
279 while (*pos < k1->
len && *pos < k2->
len)
281 if (k1->
keys[*pos] < k2->
keys[*pos])
283 else if (k1->
keys[*pos] > k2->
keys[*pos])
301 for (
int i = 0; funcs[i].
name; i++)
323 for (
int i = 0; funcs[i].
name; i++)
325 if (funcs[i].
op ==
op)
326 return funcs[i].
name;
351 for (pp = p - 1; pp >= s && *pp !=
'<'; pp--)
418 if ((c < 256) && (c > -128) && iscntrl((
unsigned char) c))
426 buf[1] = (c +
'@') & 0x7f;
431 snprintf(buf,
sizeof(buf),
"\\%d%d%d", c >> 6, (c >> 3) & 7, c & 7);
434 else if ((c >= KEY_F0) && (c < KEY_F(256)))
436 snprintf(buf,
sizeof(buf),
"<F%d>", c - KEY_F0);
438 else if ((c < 256) && (c >= -128) &&
IsPrint(c))
440 snprintf(buf,
sizeof(buf),
"%c", (
unsigned char) c);
444 snprintf(buf,
sizeof(buf),
"<%ho>", (
unsigned short) c);
470 if ((++p >= map->
len) || !len)
549#ifdef CRYPT_BACKEND_GPGME
void mutt_push_macro_event(int ch, int op)
Add the character/operation to the macro buffer.
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.
const char * km_keyname(int c)
Get the human name for a key.
struct Keymap * km_find_func(enum MenuType mtype, int func)
Find a function's mapping in a Menu.
void generic_tokenize_push_string(char *s)
Parse and queue a 'push' command.
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.
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.
const struct MenuFuncOp OpCompose[]
Functions for the Compose Menu.
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.
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.
int km_expand_key(char *s, size_t len, struct Keymap *map)
Get the key string bound to a Keymap.
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.
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.
int km_expand_key_string(char *str, char *buf, size_t buflen)
Get a human-readable key string.
const struct MenuFuncOp OpAlias[]
Functions for the Alias Menu.
static int parse_fkey(char *s)
Parse a function 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)
Convenience wrapper for the library headers.
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.
API for encryption/signing of emails.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define STAILQ_FOREACH(var, head, field)
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.
const char * name
String value.
const struct Mapping MenuNames[]
Menu name lookup table.
MenuType
Types of GUI selections.
@ MENU_KEY_SELECT_PGP
Select a PGP key.
@ MENU_INDEX
Index panel (list of emails)
@ MENU_DIALOG
Simple Dialog.
@ MENU_KEY_SELECT_SMIME
Select a SMIME key.
@ 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_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.