Function: current-input-mode
current-input-mode is a function defined in keyboard.c.
Signature
(current-input-mode)
Documentation
Return information about the way Emacs currently reads keyboard input.
The value is a list of the form (INTERRUPT FLOW META QUIT), where
INTERRUPT is non-nil if Emacs is using interrupt-driven input; if
nil, Emacs is using CBREAK mode.
FLOW is non-nil if Emacs uses ^S/^Q flow control for output to the
terminal; this does not apply if Emacs uses interrupt-driven input.
META is t if accepting 8-bit unencoded input with 8th bit as Meta flag.
META is encoded if accepting 8-bit encoded input with 8th bit as
Meta flag which has to be interpreted after decoding the input.
META is nil if ignoring the top bit of input, on the assumption that
it is a parity bit.
META is neither t nor nil if accepting 8-bit input and using
all 8 bits as the character code.
QUIT is the character Emacs currently uses to quit.
The elements of this list correspond to the arguments of
set-input-mode.
Probably introduced at or before Emacs version 29.1.
Source Code
// Defined in /usr/src/emacs/src/keyboard.c
{
struct frame *sf = XFRAME (selected_frame);
Lisp_Object interrupt = interrupt_input ? Qt : Qnil;
Lisp_Object flow, meta;
if (FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf))
{
flow = FRAME_TTY (sf)->flow_control ? Qt : Qnil;
meta = (FRAME_TTY (sf)->meta_key == 2
? make_fixnum (0)
: (CURTTY ()->meta_key == 1
? Qt
: (CURTTY ()->meta_key == 3 ? Qencoded : Qnil)));
}
else
{
flow = Qnil;
meta = Qt;
}
Lisp_Object quit = make_fixnum (quit_char);
return list4 (interrupt, flow, meta, quit);
}