Thanks to visit codestin.com
Credit goes to code.neomutt.org

NeoMutt  2025-12-11-189-gceedb6
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
get.h
Go to the documentation of this file.
1
22
23#ifndef MUTT_KEY_GET_H
24#define MUTT_KEY_GET_H
25
26#include <stdint.h>
27#include "mutt/lib.h"
28#include "menu/lib.h"
29#include "keymap.h"
30
31struct MenuDefinition;
32
33typedef uint8_t GetChFlags;
34#define GETCH_NO_FLAGS 0
35#define GETCH_IGNORE_MACRO (1 << 0)
36
37typedef uint8_t KeyGatherFlags;
38#define KEY_GATHER_NO_MATCH 0
39#define KEY_GATHER_MATCH (1 << 0)
40#define KEY_GATHER_LONGER (1 << 1)
41
42typedef uint8_t MenuFuncFlags;
43#define MFF_NO_FLAGS 0
44#define MFF_DEPRECATED (1 << 1)
45
50{
51 int ch;
52 int op;
53};
54ARRAY_HEAD(KeyEventArray, struct KeyEvent);
55
56extern struct KeyEventArray MacroEvents;
57extern struct KeyEventArray UngetKeyEvents;
58
70ARRAY_HEAD(KeymapMatchArray, struct KeymapMatch);
71
72void array_add (struct KeyEventArray *a, int ch, int op);
73struct KeyEvent *array_pop (struct KeyEventArray *a);
74void array_to_endcond (struct KeyEventArray *a);
75KeyGatherFlags gather_functions (const struct MenuDefinition *md, const keycode_t *keys, int key_len, struct KeymapMatchArray *kma);
77struct KeyEvent km_dokey (enum MenuType mtype, GetChFlags flags);
78void km_error_key (enum MenuType mtype);
79void mutt_flushinp (void);
81struct KeyEvent mutt_getch (GetChFlags flags);
82int mutt_monitor_getch (void);
83void mutt_push_macro_event (int ch, int op);
84void mutt_unget_ch (int ch);
85void mutt_unget_op (int op);
86
87#endif /* MUTT_KEY_GET_H */
#define ARRAY_HEAD(name, T)
Define a named struct for arrays of elements of a certain type.
Definition array.h:47
struct KeyEventArray MacroEvents
These are used for macros and exec/push commands.
Definition get.c:56
struct KeyEvent km_dokey(enum MenuType mtype, GetChFlags flags)
Determine what a keypress should do.
Definition get.c:431
struct KeyEventArray UngetKeyEvents
These are used in all other "normal" situations, and are not ignored when passing GETCH_IGNORE_MACRO.
Definition get.c:60
struct KeyEvent mutt_getch(GetChFlags flags)
Read a character from the input buffer.
Definition get.c:201
uint8_t GetChFlags
Flags for mutt_getch(), e.g. GETCH_NO_FLAGS.
Definition get.h:33
KeyGatherFlags gather_functions(const struct MenuDefinition *md, const keycode_t *keys, int key_len, struct KeymapMatchArray *kma)
Find functions whose keybindings match.
Definition get.c:380
void generic_tokenize_push_string(char *s)
Parse and queue a 'push' command.
Definition get.c:306
void mutt_flushinp(void)
Empty all the keyboard buffers.
Definition get.c:65
void array_add(struct KeyEventArray *a, int ch, int op)
Add an event to the end of the array.
Definition get.c:95
void array_to_endcond(struct KeyEventArray *a)
Clear the array until an OP_END_COND.
Definition get.c:105
void mutt_push_macro_event(int ch, int op)
Add the character/operation to the macro buffer.
Definition get.c:146
void mutt_unget_op(int op)
Return an operation to the input buffer.
Definition get.c:133
int mutt_monitor_getch(void)
Get a character and poll the filesystem monitor.
Definition get.c:168
uint8_t KeyGatherFlags
Flags for gather_functions(), e.g. KEY_GATHER_NO_MATCH.
Definition get.h:37
void mutt_flush_macro_to_endcond(void)
Drop a macro from the input buffer.
Definition get.c:157
uint8_t MenuFuncFlags
Flags, e.g. MFF_DEPRECATED.
Definition get.h:42
struct KeyEvent * array_pop(struct KeyEventArray *a)
Remove an event from the array.
Definition get.c:77
void mutt_unget_ch(int ch)
Return a keystroke to the input buffer.
Definition get.c:122
void km_error_key(enum MenuType mtype)
Handle an unbound key sequence.
Definition get.c:285
Keymap handling.
short keycode_t
Type for key storage, the rest of neomutt works fine with int type.
Definition keymap.h:31
GUI present the user with a selectable list.
Convenience wrapper for the library headers.
An event such as a keypress.
Definition get.h:50
int op
Function opcode, e.g. OP_HELP.
Definition get.h:52
int ch
Raw key pressed.
Definition get.h:51
Result of Matching Keybinding.
Definition get.h:65
KeyGatherFlags flags
Flags, e.g. KEY_GATHER_MATCH.
Definition get.h:67
struct Keymap * keymap
Keymap defining bind or `macro.
Definition get.h:68
enum MenuType mtype
Menu Type, e.g. MENU_INDEX.
Definition get.h:66
A keyboard mapping.
Definition keymap.h:43
short op
Operation to perform.
Definition keymap.h:46
Functions for a Dialog or Window.
Definition menu.h:81
MenuType
Types of GUI selections.
Definition type.h:33