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 | KEY_COUNT_MAX_DIGITS 6 |
Maximum number of digits in a key count prefix, e.g. 123j | |
| #define | KEY_SEQ_MAX_LEN 8 |
Maximum number of keys in a key sequence, e.g. abc | |
Typedefs | |
| typedef uint8_t | GetChFlags |
| typedef uint8_t | KeyGatherFlags |
| typedef uint8_t | MenuFuncFlags |
Enumerations | |
| enum | GetChFlag { GETCH_NONE = 0 , GETCH_IGNORE_MACRO = 1U << 0 , GETCH_NO_COUNTER = 1U << 1 , GETCH_NO_FEEDBACK = 1U << 2 } |
| Flags for mutt_getch(), e.g. More... | |
| enum | KeyGatherFlag { KEY_GATHER_NO_MATCH = 0 , KEY_GATHER_MATCH = 1U << 0 , KEY_GATHER_LONGER = 1U << 1 } |
| Flags for gather_functions(), e.g. More... | |
| enum | MenuFuncFlag { MFF_NONE = 0 , MFF_DEPRECATED = 1U << 1 } |
| Menu function property flags. More... | |
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) |
| MacroEvents moved to KeyModuleData UngetKeyEvents moved to KeyModuleData. | |
| 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) |
| void | mutt_push_macro_event (int ch, int op) |
| Add the character/operation to the macro buffer. | |
| void | mutt_push_macro_repeated (char *macro, int count) |
| Push a macro string into the input queue, optionally repeated. | |
| 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. | |
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_COUNT_MAX_DIGITS 6 |
| #define KEY_SEQ_MAX_LEN 8 |
| typedef uint8_t GetChFlags |
| typedef uint8_t KeyGatherFlags |
| typedef uint8_t MenuFuncFlags |
| enum GetChFlag |
Flags for mutt_getch(), e.g.
| Enumerator | |
|---|---|
| GETCH_NONE | No flags are set. |
| GETCH_IGNORE_MACRO | Don't use MacroEvents. |
| GETCH_NO_COUNTER | km_dokey(): disable numeric count prefix parsing |
| GETCH_NO_FEEDBACK | km_dokey(): suppress key progress notifications |
Definition at line 36 of file get.h.
| enum KeyGatherFlag |
Flags for gather_functions(), e.g.
| Enumerator | |
|---|---|
| KEY_GATHER_NO_MATCH | No bindings match the search string. |
| KEY_GATHER_MATCH | Binding matches the search string. |
| KEY_GATHER_LONGER | No bindings match, but longer strings might. |
| enum MenuFuncFlag |
Menu function property flags.
| Enumerator | |
|---|---|
| MFF_NONE | No flags are set. |
| MFF_DEPRECATED | Function is 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 102 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 427 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 352 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 518 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 328 of file get.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_flushinp | ( | void | ) |
MacroEvents moved to KeyModuleData UngetKeyEvents moved to KeyModuleData.
Empty all the keyboard buffers
Definition at line 81 of file get.c.
Here is the call graph for this function:
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 185 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 }{ 0, OP_REPAINT, 0 }{ 0, OP_TIMEOUT, 0 } Definition at line 319 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 | ) |
| 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 173 of file get.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_push_macro_repeated | ( | char * | macro, |
| int | count ) |
Push a macro string into the input queue, optionally repeated.
| macro | Macro string to expand |
| count | Number of times to repeat (0 or 1 means once) |
The repeat count is clamped to $macro_repeat_max to bound queue growth.
Definition at line 60 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 | ) |