NeoMutt  2025-12-11-860-g80c9cc
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#define GETCH_NO_COUNTER (1 << 1)
37#define GETCH_NO_FEEDBACK (1 << 2)
38
40#define KEY_COUNT_MAX_DIGITS 6
42#define KEY_SEQ_MAX_LEN 8
43
44typedef uint8_t KeyGatherFlags;
45#define KEY_GATHER_NO_MATCH 0
46#define KEY_GATHER_MATCH (1 << 0)
47#define KEY_GATHER_LONGER (1 << 1)
48
49typedef uint8_t MenuFuncFlags;
50#define MFF_NO_FLAGS 0
51#define MFF_DEPRECATED (1 << 1)
52
57{
58 int ch;
59 int op;
60 int count;
61};
62ARRAY_HEAD(KeyEventArray, struct KeyEvent);
63
75ARRAY_HEAD(KeymapMatchArray, struct KeymapMatch);
76
77void array_add (struct KeyEventArray *a, int ch, int op);
78struct KeyEvent *array_pop (struct KeyEventArray *a);
79void array_to_endcond (struct KeyEventArray *a);
80KeyGatherFlags gather_functions (const struct MenuDefinition *md, const keycode_t *keys, int key_len, struct KeymapMatchArray *kma);
82struct KeyEvent km_dokey (const struct MenuDefinition *md, GetChFlags flags);
83void km_error_key (const struct MenuDefinition *md);
84void mutt_flushinp (void);
86struct KeyEvent mutt_getch (GetChFlags flags);
88void mutt_push_macro_event (int ch, int op);
89void mutt_push_macro_repeated (char *macro, int count);
90void mutt_unget_ch (int ch);
91void mutt_unget_op (int op);
92
93#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 KeyEvent mutt_getch(GetChFlags flags)
Read a character from the input buffer.
Definition get.c:319
struct KeyEvent km_dokey(const struct MenuDefinition *md, GetChFlags flags)
Determine what a keypress should do.
Definition get.c:518
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:427
void generic_tokenize_push_string(char *s)
Parse and queue a 'push' command.
Definition get.c:352
void mutt_push_macro_repeated(char *macro, int count)
Push a macro string into the input queue, optionally repeated.
Definition get.c:60
void mutt_flushinp(void)
MacroEvents moved to KeyModuleData UngetKeyEvents moved to KeyModuleData.
Definition get.c:81
void array_add(struct KeyEventArray *a, int ch, int op)
Add an event to the end of the array.
Definition get.c:120
void array_to_endcond(struct KeyEventArray *a)
Clear the array until an OP_END_COND.
Definition get.c:130
void mutt_push_macro_event(int ch, int op)
Add the character/operation to the macro buffer.
Definition get.c:173
void mutt_unget_op(int op)
Return an operation to the input buffer.
Definition get.c:159
void km_error_key(const struct MenuDefinition *md)
Handle an unbound key sequence.
Definition get.c:328
int mutt_monitor_getch(void)
uint8_t KeyGatherFlags
Flags for gather_functions(), e.g. KEY_GATHER_NO_MATCH.
Definition get.h:44
void mutt_flush_macro_to_endcond(void)
Drop a macro from the input buffer.
Definition get.c:185
uint8_t MenuFuncFlags
Flags, e.g. MFF_DEPRECATED.
Definition get.h:49
struct KeyEvent * array_pop(struct KeyEventArray *a)
Remove an event from the array.
Definition get.c:102
void mutt_unget_ch(int ch)
Return a keystroke to the input buffer.
Definition get.c:147
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:57
int count
Optional count prefix, e.g. 3 for 3j
Definition get.h:60
int op
Function opcode, e.g. OP_HELP.
Definition get.h:59
int ch
Raw key pressed.
Definition get.h:58
Result of Matching Keybinding.
Definition get.h:70
KeyGatherFlags flags
Flags, e.g. KEY_GATHER_MATCH.
Definition get.h:72
struct Keymap * keymap
Keymap defining bind or `macro.
Definition get.h:73
enum MenuType mtype
Menu Type, e.g. MENU_INDEX.
Definition get.h:71
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:77
MenuType
Types of GUI selections.
Definition type.h:33