240 if (
ch == KEY_RESIZE)
243 while ((
ch = getch()) == KEY_RESIZE)
251 if (!isatty(STDIN_FILENO))
258 return event_repaint;
262 return event_timeout;
276 return (
struct KeyEvent) {
'\033', OP_NULL };
325 for (pp = p - 1; pp >= s && *pp !=
'<'; pp--)
387 int key_len,
struct KeymapMatchArray *kma)
389 if (!md || !keys || !kma)
403 for (
int i = 0; i < key_len; i++)
415 if (km->
len == key_len)
439 struct KeyEvent event = { 0, OP_NULL };
452 if (event.
op < OP_NULL)
460 keys[pos] =
event.ch;
483 if (map->
op != OP_MACRO)
488 return (
struct KeyEvent) {
event.ch, map->
op };
504 return (
struct KeyEvent) {
event.ch, OP_NULL };
517 isprint(event.
ch) ? event.
ch :
'?');
#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_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_FREE(head)
Release all memory.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
#define ARRAY_SHRINK(head, n)
Mark a number of slots at the end of the array as unused.
size_t buf_strcpy_n(struct Buffer *buf, const char *s, size_t len)
Copy a string into a Buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
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_exit(int code)
Leave NeoMutt NOW.
KeyGatherFlags gather_functions(const struct MenuDefinition *md, const keycode_t *keys, int key_len, struct KeymapMatchArray *kma)
Find functions whose keybindings match.
void generic_tokenize_push_string(char *s)
Parse and queue a 'push' command.
void mutt_flushinp(void)
MacroEvents moved to KeyModuleData UngetKeyEvents moved to KeyModuleData.
static const int MaxKeyLoop
XXX.
void array_add(struct KeyEventArray *a, int ch, int op)
Add an event to the end of the array.
void array_to_endcond(struct KeyEventArray *a)
Clear the array until an OP_END_COND.
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.
struct KeyEvent km_dokey(const struct MenuDefinition *md, GetChFlags flags)
Determine what a keypress should do.
void mutt_unget_op(int op)
Return an operation to the input buffer.
void km_error_key(const struct MenuDefinition *md)
Handle an unbound key sequence.
int mutt_monitor_getch(void)
Get a character and poll the filesystem monitor.
void mutt_flush_macro_to_endcond(void)
Drop a macro from the input buffer.
struct KeyEvent * array_pop(struct KeyEventArray *a)
Remove an event from the array.
void mutt_unget_ch(int ch)
Return a keystroke to the input buffer.
uint8_t GetChFlags
Flags for mutt_getch(), e.g. GETCH_NO_FLAGS.
#define GETCH_IGNORE_MACRO
Don't use MacroEvents.
#define KEY_GATHER_LONGER
No bindings match, but longer strings might.
#define KEY_GATHER_NO_MATCH
No bindings match the search string.
int mutt_monitor_getch(void)
Get a character and poll the filesystem monitor.
uint8_t KeyGatherFlags
Flags for gather_functions(), e.g. KEY_GATHER_NO_MATCH.
#define KEY_GATHER_MATCH
Binding matches the search string.
struct KeyEvent * array_pop(struct KeyEventArray *a)
Remove an event from the array.
void mutt_unget_ch(int ch)
Return a keystroke to the input buffer.
bool OptGui
(pseudo) when the gui (and curses) are started
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
bool keymap_expand_key(struct Keymap *km, struct Buffer *buf)
Get the key string bound to a Keymap.
int parse_fkey(char *str)
Parse a function key string.
short keycode_t
Type for key storage, the rest of neomutt works fine with int type.
@ LL_DEBUG1
Log at debug level 1.
@ MODULE_ID_KEY
ModuleKey, Key mappings
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.
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.
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
@ NT_TIMEOUT
Timeout has occurred.
@ NT_RESIZE
Window has been resized.
const char * opcodes_get_name(int op)
Get the name of an opcode.
#define OP_TIMEOUT
1 second with no events
#define OP_REPAINT
Repaint is needed.
#define OP_ABORT
$abort_key pressed (Ctrl-G)
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)
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)
String manipulation buffer.
An event such as a keypress.
int op
Function opcode, e.g. OP_HELP.
struct KeyEventArray macro_events
Macro event buffer.
keycode_t abort_key
Key to abort prompts, normally Ctrl-G.
struct Mapping * key_names
Key name lookup table.
struct KeyEventArray unget_key_events
Unget key event buffer.
Result of Matching Keybinding.
KeyGatherFlags flags
Flags, e.g. KEY_GATHER_MATCH.
struct Keymap * keymap
Keymap defining bind or `macro.
keycode_t * keys
Key sequence.
char * macro
Macro expansion (op == OP_MACRO)
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.
MenuType
Types of GUI selections.