NeoMutt  2025-12-11-87-gae07fd
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
31typedef uint8_t GetChFlags;
32#define GETCH_NO_FLAGS 0
33#define GETCH_IGNORE_MACRO (1 << 0)
34
35typedef uint8_t MenuFuncFlags;
36#define MFF_NO_FLAGS 0
37#define MFF_DEPRECATED (1 << 1)
38
43{
44 int ch;
45 int op;
46};
47ARRAY_HEAD(KeyEventArray, struct KeyEvent);
48
49extern struct KeyEventArray MacroEvents;
50extern struct KeyEventArray UngetKeyEvents;
51
52void array_add (struct KeyEventArray *a, int ch, int op);
53struct KeyEvent *array_pop (struct KeyEventArray *a);
54void array_to_endcond (struct KeyEventArray *a);
56void mutt_flushinp (void);
58struct KeyEvent mutt_getch (GetChFlags flags);
59void mutt_push_macro_event (int ch, int op);
60void mutt_unget_ch (int ch);
61void mutt_unget_op (int op);
62void mutt_unget_string (const char *s);
63
64#endif /* MUTT_KEY_GET_H */
#define ARRAY_HEAD(name, type)
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:49
struct KeyEventArray UngetKeyEvents
These are used in all other "normal" situations, and are not ignored when passing GETCH_IGNORE_MACRO.
Definition get.c:53
struct KeyEvent mutt_getch(GetChFlags flags)
Read a character from the input buffer.
Definition get.c:210
uint8_t GetChFlags
Flags for mutt_getch(), e.g. GETCH_NO_FLAGS.
Definition get.h:31
void generic_tokenize_push_string(char *s)
Parse and queue a 'push' command.
Definition get.c:348
void mutt_flushinp(void)
Empty all the keyboard buffers.
Definition get.c:58
void array_add(struct KeyEventArray *a, int ch, int op)
Add an event to the end of the array.
Definition get.c:88
void array_to_endcond(struct KeyEventArray *a)
Clear the array until an OP_END_COND.
Definition get.c:98
void mutt_unget_string(const char *s)
Return a string to the input buffer.
Definition get.c:137
void mutt_push_macro_event(int ch, int op)
Add the character/operation to the macro buffer.
Definition get.c:155
void mutt_unget_op(int op)
Return an operation to the input buffer.
Definition get.c:126
void mutt_flush_macro_to_endcond(void)
Drop a macro from the input buffer.
Definition get.c:166
uint8_t MenuFuncFlags
Flags, e.g. MFF_DEPRECATED.
Definition get.h:35
struct KeyEvent * array_pop(struct KeyEventArray *a)
Remove an event from the array.
Definition get.c:70
void mutt_unget_ch(int ch)
Return a keystroke to the input buffer.
Definition get.c:115
Keymap handling.
GUI present the user with a selectable list.
Convenience wrapper for the library headers.
An event such as a keypress.
Definition get.h:43
int op
Function opcode, e.g. OP_HELP.
Definition get.h:45
int ch
Raw key pressed.
Definition get.h:44