Get a key from the user. More...
Include dependency graph for get.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | KeyEvent |
| An event such as a keypress. More... | |
| struct | KeymapMatch |
| Result of Matching Keybinding. More... | |
Macros | |
| #define | GETCH_NO_FLAGS 0 |
| No flags are set. | |
| #define | GETCH_IGNORE_MACRO (1 << 0) |
| Don't use MacroEvents. | |
| #define | KEY_GATHER_NO_MATCH 0 |
| No bindings match the search string. | |
| #define | KEY_GATHER_MATCH (1 << 0) |
| Binding matches the search string. | |
| #define | KEY_GATHER_LONGER (1 << 1) |
| No bindings match, but longer strings might. | |
| #define | MFF_NO_FLAGS 0 |
| No flags are set. | |
| #define | MFF_DEPRECATED (1 << 1) |
| Redraw the pager. | |
Typedefs | |
| typedef uint8_t | GetChFlags |
| Flags for mutt_getch(), e.g. GETCH_NO_FLAGS. | |
| typedef uint8_t | KeyGatherFlags |
| Flags for gather_functions(), e.g. KEY_GATHER_NO_MATCH. | |
| typedef uint8_t | MenuFuncFlags |
| Flags, e.g. MFF_DEPRECATED. | |
Functions | |
| ARRAY_HEAD (KeyEventArray, struct KeyEvent) | |
| ARRAY_HEAD (KeymapMatchArray, struct KeymapMatch) | |
| void | array_add (struct KeyEventArray *a, int ch, int op) |
| Add an event to the end of the array. | |
| struct KeyEvent * | array_pop (struct KeyEventArray *a) |
| Remove an event from the array. | |
| void | array_to_endcond (struct KeyEventArray *a) |
| Clear the array until an OP_END_COND. | |
| 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. | |
| struct KeyEvent | km_dokey (const struct MenuDefinition *md, GetChFlags flags) |
| Determine what a keypress should do. | |
| void | km_error_key (const struct MenuDefinition *md) |
| Handle an unbound key sequence. | |
| void | mutt_flushinp (void) |
| Empty all the keyboard buffers. | |
| void | mutt_flush_macro_to_endcond (void) |
| Drop a macro from the input buffer. | |
| struct KeyEvent | mutt_getch (GetChFlags flags) |
| Read a character from the input buffer. | |
| int | mutt_monitor_getch (void) |
| Get a character and poll the filesystem monitor. | |
| void | mutt_push_macro_event (int ch, int op) |
| Add the character/operation to the macro buffer. | |
| void | mutt_unget_ch (int ch) |
| Return a keystroke to the input buffer. | |
| void | mutt_unget_op (int op) |
| Return an operation to the input buffer. | |
Variables | |
| struct KeyEventArray | MacroEvents |
| These are used for macros and exec/push commands. | |
| struct KeyEventArray | UngetKeyEvents |
| These are used in all other "normal" situations, and are not ignored when passing GETCH_IGNORE_MACRO. | |
Get a key from the user.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file get.h.
| #define KEY_GATHER_NO_MATCH 0 |
| #define KEY_GATHER_MATCH (1 << 0) |
| #define KEY_GATHER_LONGER (1 << 1) |
| typedef uint8_t GetChFlags |
Flags for mutt_getch(), e.g. GETCH_NO_FLAGS.
| typedef uint8_t KeyGatherFlags |
Flags for gather_functions(), e.g. KEY_GATHER_NO_MATCH.
| typedef uint8_t MenuFuncFlags |
Flags, e.g. MFF_DEPRECATED.
| ARRAY_HEAD | ( | KeyEventArray | , |
| struct KeyEvent | ) |
| ARRAY_HEAD | ( | KeymapMatchArray | , |
| struct KeymapMatch | ) |
Here is the call graph for this function:| void array_add | ( | struct KeyEventArray * | a, |
| int | ch, | ||
| int | op ) |
| struct KeyEvent * array_pop | ( | struct KeyEventArray * | a | ) |
Remove an event from the array.
| a | Array |
| ptr | Event |
Definition at line 77 of file get.c.
Here is the caller graph for this function:| void array_to_endcond | ( | struct KeyEventArray * | a | ) |
| KeyGatherFlags gather_functions | ( | const struct MenuDefinition * | md, |
| const keycode_t * | keys, | ||
| int | key_len, | ||
| struct KeymapMatchArray * | kma ) |
Find functions whose keybindings match.
| [in] | md | Menu Definition of all valid functions |
| [in] | keys | User-entered key string to match |
| [in] | key_len | Length of key string |
| [out] | kma | Array for the results |
| flags | Results, e.g. KEY_GATHER_MATCH |
Definition at line 383 of file get.c.
Here is the caller graph for this function:| void generic_tokenize_push_string | ( | char * | s | ) |
Parse and queue a 'push' command.
| s | String to push into the key queue |
Parses s for <function> syntax and adds the whole sequence the macro buffer.
Definition at line 309 of file get.c.
Here is the call graph for this function:
Here is the caller graph for this function:| struct KeyEvent km_dokey | ( | const struct MenuDefinition * | md, |
| GetChFlags | flags ) |
Determine what a keypress should do.
| md | Menu Definition |
| flags | Flags, e.g. GETCH_IGNORE_MACRO |
| ptr | Event |
Definition at line 434 of file get.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void km_error_key | ( | const struct MenuDefinition * | md | ) |
Handle an unbound key sequence.
| md | Menu Definition |
Definition at line 285 of file get.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_flushinp | ( | void | ) |
Empty all the keyboard buffers.
Definition at line 65 of file get.c.
Here is the caller graph for this function:| void mutt_flush_macro_to_endcond | ( | void | ) |
Drop a macro from the input buffer.
All the macro text is deleted until an OP_END_COND command, or the buffer is empty.
Definition at line 157 of file get.c.
Here is the call graph for this function:
Here is the caller graph for this function:| struct KeyEvent mutt_getch | ( | GetChFlags | flags | ) |
Read a character from the input buffer.
| flags | Flags, e.g. GETCH_IGNORE_MACRO |
| obj | KeyEvent to process |
The priority for reading events is:
This function can return:
{ 0, OP_ABORT }{ 0, OP_REPAINT }{ 0, OP_TIMEOUT } Definition at line 201 of file get.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int mutt_monitor_getch | ( | void | ) |
Get a character and poll the filesystem monitor.
| num | Character pressed |
| ERR | Timeout |
Definition at line 168 of file get.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_push_macro_event | ( | int | ch, |
| int | op ) |
Add the character/operation to the macro buffer.
| ch | Character to add |
| op | Operation to add |
Adds the ch/op to the macro buffer. This should be used for macros, push, and exec commands only.
Definition at line 146 of file get.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_unget_ch | ( | int | ch | ) |
| void mutt_unget_op | ( | int | op | ) |
|
extern |
These are used for macros and exec/push commands.
They can be temporarily ignored by passing GETCH_IGNORE_MACRO
|
extern |
These are used in all other "normal" situations, and are not ignored when passing GETCH_IGNORE_MACRO.