NeoMutt  2025-12-11-911-gd8d604
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
37{
40 GETCH_NO_COUNTER = 1U << 1,
42};
43typedef uint8_t GetChFlags;
44
46#define KEY_COUNT_MAX_DIGITS 6
48#define KEY_SEQ_MAX_LEN 8
49
59typedef uint8_t KeyGatherFlags;
60
65{
67 MFF_DEPRECATED = 1U << 1,
68};
69typedef uint8_t MenuFuncFlags;
70
75{
76 int ch;
77 int op;
78 int count;
79};
80ARRAY_HEAD(KeyEventArray, struct KeyEvent);
81
93ARRAY_HEAD(KeymapMatchArray, struct KeymapMatch);
94
95void array_add (struct KeyEventArray *a, int ch, int op);
96struct KeyEvent *array_pop (struct KeyEventArray *a);
97void array_to_endcond (struct KeyEventArray *a);
98KeyGatherFlags gather_functions (const struct MenuDefinition *md, const keycode_t *keys, int key_len, struct KeymapMatchArray *kma);
100struct KeyEvent km_dokey (const struct MenuDefinition *md, GetChFlags flags);
101void km_error_key (const struct MenuDefinition *md);
102void mutt_flushinp (void);
104struct KeyEvent mutt_getch (GetChFlags flags);
106void mutt_push_macro_event (int ch, int op);
107void mutt_push_macro_repeated (char *macro, int count);
108void mutt_unget_ch (int ch);
109void mutt_unget_op (int op);
110
111#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
Definition get.h:43
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
GetChFlag
Flags for mutt_getch(), e.g.
Definition get.h:37
@ GETCH_NONE
No flags are set.
Definition get.h:38
@ GETCH_IGNORE_MACRO
Don't use MacroEvents.
Definition get.h:39
@ GETCH_NO_FEEDBACK
km_dokey(): suppress key progress notifications
Definition get.h:41
@ GETCH_NO_COUNTER
km_dokey(): disable numeric count prefix parsing
Definition get.h:40
void mutt_push_macro_repeated(char *macro, int count)
Push a macro string into the input queue, optionally repeated.
Definition get.c:60
KeyGatherFlag
Flags for gather_functions(), e.g.
Definition get.h:54
@ KEY_GATHER_NO_MATCH
No bindings match the search string.
Definition get.h:55
@ KEY_GATHER_LONGER
No bindings match, but longer strings might.
Definition get.h:57
@ KEY_GATHER_MATCH
Binding matches the search string.
Definition get.h:56
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
Definition get.h:59
void mutt_flush_macro_to_endcond(void)
Drop a macro from the input buffer.
Definition get.c:185
uint8_t MenuFuncFlags
Definition get.h:69
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
MenuFuncFlag
Menu function property flags.
Definition get.h:65
@ MFF_DEPRECATED
Function is deprecated.
Definition get.h:67
@ MFF_NONE
No flags are set.
Definition get.h:66
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:75
int count
Optional count prefix, e.g. 3 for 3j
Definition get.h:78
int op
Function opcode, e.g. OP_HELP.
Definition get.h:77
int ch
Raw key pressed.
Definition get.h:76
Result of Matching Keybinding.
Definition get.h:88
KeyGatherFlags flags
Flags, e.g. KEY_GATHER_MATCH.
Definition get.h:90
struct Keymap * keymap
Keymap defining bind or `macro.
Definition get.h:91
enum MenuType mtype
Menu Type, e.g. MENU_INDEX.
Definition get.h:89
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