Next: , Previous: , Up: Events and the Event Loop   [Contents][Index]


13.7 Other Event Loop Functions

detect_input_pending() and input-pending-p look for input by calling event_stream->event_pending_p and looking in [V]unread-command-event and the command_event_queue (they do not check for an executing keyboard macro, though).

discard-input cancels any command events pending (and any keyboard macros currently executing), and puts the others onto the command_event_queue. There is a comment about a “race condition”, which is not a good sign.

next-command-event and read-char are higher-level interfaces to next-event. next-command-event gets the next command event (i.e. keypress, mouse event, menu selection, or scrollbar action), calling dispatch-event on any others. read-char calls next-command-event and uses event_to_character() to return the character equivalent. With the right kind of input method support, it is possible for (read-char) to return a Kanji character.