Function: read-char-exclusive

read-char-exclusive is a function defined in keyboard.c.

Signature

(read-char-exclusive &optional PROMPT INHERIT-INPUT-METHOD SECONDS)

Documentation

Read a character event from the command input (keyboard or macro).

Return the character as a number. Non-character events are ignored. If the event has modifiers, they are resolved and reflected in the returned character code if possible (e.g. C-SPC yields 0 and C-a yields 97). If some of the modifiers cannot be reflected in the character code, the returned value will include those modifiers, and will not be a valid character code: it will fail the characterp test. Use event-basic-type to recover the character code with the modifiers removed.

If the optional argument PROMPT is non-nil, display that as a prompt. If PROMPT is nil or the string "", the key sequence/events that led to the current command is used as the prompt.

If the optional argument INHERIT-INPUT-METHOD is non-nil and some input method is turned on in the current buffer, that input method is used for reading a character.

If the optional argument SECONDS is non-nil, it should be a number specifying the maximum number of seconds to wait for input. If no input arrives in that time, return nil. SECONDS may be a floating-point value.

If inhibit-interaction is non-nil, this function will signal an inhibited-interaction error.

View in manual

Probably introduced at or before Emacs version 20.3.

Source Code

// Defined in /usr/src/emacs/src/keyboard.c
{
  Lisp_Object val;

  barf_if_interaction_inhibited ();

  if (! NILP (prompt))
    {
      cancel_echoing ();
      message_with_string ("%s", prompt, 0);
    }

  val = read_filtered_event (1, 1, 0, ! NILP (inherit_input_method), seconds);

  return (!FIXNUMP (val) ? Qnil
	  : make_fixnum (char_resolve_modifier_mask (XFIXNUM (val))));
}