Can return a special key or a multi-byte character.
Can return NUL when called recursively, use safe_vgetc() if that's not wanted.
This translates escaped K_SPECIAL and CSI bytes to a K_SPECIAL or CSI byte.
Collects the bytes of a multibyte character into the whole character.
Returns the modifiers in the global "mod_mask".
safe_vgetc()
Like vgetc(), but never returns a NUL when called recursively, get a key directly from the user (ignoring typeahead).
If there is no new character after updatetime, safe_vgetc returns K_CURSORHOLD.
vgetorpeek(int advance)
Get a «byte».
If advance is TRUE:
the character is really gotten
KeyTyped is set to TRUE if the key comes from the keyboard
KeyStuffed is set(?) to TRUE if the character comes from the stuff buffer
If advance is FALSE, it is only checked whtere a character is available. If not, NUL is returned.
TODO: function might call handle_mapping.
ins_typebuf()
Inserts a string at a given position (offset) into the typeahead buffer.
inchar()
Gets a character either from a script file or the keyboard
Compare with the similarly sounding function inchar_loop()
flush_buffers()
flush_buffers() removes the contents of the stuff buffer and the mapped characters in the typeahead buffer.
vim.h define the enum flush_buffers_T which specifies the possible arguments for flush_buffers():
typedef enum {
FLUSH_MINIMAL,
FLUSH_TYPEAHEAD, // flush current typebuf contents
FLUSH_INPUT // flush typebuf and inchar() input
} flush_buffers_T;
inchar()
inchar() gets one character from a script file or the keyboard.
input_available()
Return TRUE when bytes are in the input buffer or in the typeahead buffer.
Normally the input buffer would be sufficient, but the server_to_input_buf() or feedkeys() may insert characters in the typeahead buffer while we are waiting for input to arrive.
read_readbuffers()
Gets one byte from the read buffers.
stuffcharReadbuff()
Appends a character to the stuff buffer by calling
add_char_buff(&readbuf1, c);
In the declaration of readbuf1, the variable is called First read ahead buffer. Used for translated commands.