Function: set-input-interrupt-mode

set-input-interrupt-mode is a function defined in keyboard.c.

Signature

(set-input-interrupt-mode INTERRUPT)

Documentation

Set interrupt mode of reading keyboard input.

If INTERRUPT is non-nil, Emacs will use input interrupts; otherwise Emacs uses CBREAK mode.

See also current-input-mode.

Source Code

// Defined in /usr/src/emacs/src/keyboard.c
{
  bool new_interrupt_input;
#ifdef USABLE_SIGIO
#ifdef HAVE_X_WINDOWS
  if (x_display_list != NULL)
    {
      /* When using X, don't give the user a real choice,
	 because we haven't implemented the mechanisms to support it.  */
      new_interrupt_input = true;
    }
  else
#endif /* HAVE_X_WINDOWS */
    new_interrupt_input = !NILP (interrupt);
#else /* not USABLE_SIGIO */
  new_interrupt_input = false;
#endif /* not USABLE_SIGIO */

  if (new_interrupt_input != interrupt_input)
    {
#ifdef POLL_FOR_INPUT
      stop_polling ();
#endif
#ifndef DOS_NT
      /* this causes startup screen to be restored and messes with the mouse */
      reset_all_sys_modes ();
      interrupt_input = new_interrupt_input;
      init_all_sys_modes ();
#else
      interrupt_input = new_interrupt_input;
#endif

#ifdef POLL_FOR_INPUT
      poll_suppress_count = 1;
      start_polling ();
#endif
    }
  return Qnil;
}