247 if (
ch == KEY_RESIZE)
250 while ((
ch = getch()) == KEY_RESIZE)
265 return event_repaint;
269 return event_timeout;
283 return (
struct KeyEvent){
'\033', OP_NULL };
305 char buf[128] = { 0 };
307 mutt_error(
_(
"Key is not bound. Press '%s' for help."), buf);
324 for (; keyslen; keyslen--)
348 struct KeyEvent event = { 0, OP_NULL };
361 if (event.
op < OP_NULL)
365 if (event.
op != OP_NULL)
367 const char *func = NULL;
409 while (event.
ch > map->
keys[pos])
416 if (event.
ch != map->
keys[pos])
419 if (++pos == map->
len)
421 if (map->
op != OP_MACRO)
422 return (
struct KeyEvent){
event.ch, map->
op };
436 return (
struct KeyEvent){
event.ch, OP_NULL };
#define ARRAY_SHRINK(head, num)
Mark a number of slots at the end of the array as unused.
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_LAST(head)
Convenience method to get the last element.
#define ARRAY_EMPTY(head)
Check if an array is empty.
#define ARRAY_SIZE(head)
The number of elements stored.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
void mutt_query_exit(void)
Ask the user if they want to leave NeoMutt.
void mutt_flushinp(void)
Empty all the keyboard buffers.
void mutt_unget_string(const char *s)
Return a string to the input buffer.
struct KeyEvent mutt_getch(GetChFlags flags)
Read a character from the input buffer.
void mutt_unget_ch(int ch)
Return a keystroke to the input buffer.
struct KeyEvent km_dokey_event(enum MenuType mtype, GetChFlags flags)
Determine what a keypress should do.
struct KeyEventArray MacroEvents
These are used for macros and exec/push commands.
void mutt_flushinp(void)
Empty all the keyboard buffers.
static struct KeyEventArray UngetKeyEvents
These are used in all other "normal" situations, and are not ignored when passing GETCH_IGNORE_MACRO.
int km_dokey(enum MenuType mtype, GetChFlags flags)
Determine what a keypress should do.
static void array_add(struct KeyEventArray *a, int ch, int op)
Add an event to the end of the array.
static void array_to_endcond(struct KeyEventArray *a)
Clear the array until an OP_END_COND.
void mutt_unget_string(const char *s)
Return a string to the input buffer.
void mutt_push_macro_event(int ch, int op)
Add the character/operation to the macro buffer.
struct KeyEvent mutt_getch(GetChFlags flags)
Read a character from the input buffer.
static struct KeyEvent * array_pop(struct KeyEventArray *a)
Remove an event from the array.
void mutt_unget_op(int op)
Return an operation to the input buffer.
void mutt_flush_macro_to_endcond(void)
Drop a macro from the input buffer.
static int mutt_monitor_getch(void)
Get a character and poll the filesystem monitor.
void mutt_unget_ch(int ch)
Return a keystroke to the input buffer.
void km_error_key(enum MenuType mtype)
Handle an unbound key sequence.
static struct KeyEvent retry_generic(enum MenuType mtype, keycode_t *keys, int keyslen, int lastkey, GetChFlags flags)
Try to find the key in the generic menu bindings.
bool OptNoCurses
(pseudo) when sending in batch mode
const struct MenuFuncOp OpGeneric[]
Functions for the Generic Menu.
Convenience wrapper for the gui headers.
struct Keymap * km_find_func(enum MenuType mtype, int func)
Find a function's mapping in a Menu.
int km_expand_key(char *s, size_t len, struct Keymap *map)
Get the key string bound to a Keymap.
uint8_t GetChFlags
Flags for mutt_getch(), e.g. GETCH_NO_FLAGS.
struct KeyEventArray MacroEvents
These are used for macros and exec/push commands.
void generic_tokenize_push_string(char *s)
Parse and queue a 'push' command.
keycode_t AbortKey
key to abort edits etc, normally Ctrl-G
#define GETCH_IGNORE_MACRO
Don't use MacroEvents.
const char * mutt_get_func(const struct MenuFuncOp *bindings, int op)
Get the name of a function.
short keycode_t
Type for key storage, the rest of neomutt works fine with int type.
const struct MenuFuncOp * km_get_table(enum MenuType mtype)
Lookup a Menu's functions.
struct KeymapList Keymaps[]
Array of Keymap keybindings, one for each Menu.
void mutt_exit(int code)
Leave NeoMutt NOW.
int mutt_monitor_poll(void)
Check for filesystem changes.
Monitor files for changes.
Convenience wrapper for the library headers.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
@ NT_TIMEOUT
Timeout has occurred.
@ NT_RESIZE
Window has been resized.
#define OP_TIMEOUT
1 second with no events
#define OP_REPAINT
Repaint is needed.
#define OP_ABORT
$abort_key pressed (Ctrl-G)
#define STAILQ_FIRST(head)
#define STAILQ_NEXT(elm, field)
volatile sig_atomic_t SigWinch
true after SIGWINCH is received
volatile sig_atomic_t SigInt
true after SIGINT is received
void mutt_sig_allow_interrupt(bool allow)
Allow/disallow Ctrl-C (SIGINT)
An event such as a keypress.
int op
Function opcode, e.g. OP_HELP.
keycode_t * keys
key sequence
char * macro
Macro expansion (op == OP_MACRO)
short eq
Number of leading keys equal to next entry.
short len
Length of key sequence (unit: sizeof (keycode_t))
short op
Operation to perform.
const char * name
String value.
Container for Accounts, Notifications.
struct Notify * notify_timeout
Timeout notifications handler.
struct Notify * notify_resize
Window resize notifications handler.
struct ConfigSubset * sub
Inherited config items.
const struct Mapping MenuNames[]
Menu name lookup table.
MenuType
Types of GUI selections.
@ MENU_GENERIC
Generic selection list.
@ MENU_PAGER
Pager pager (email viewer)
@ MENU_EDITOR
Text entry area.