Skip to main content

21.7 Input Events

The Emacs command loop reads a sequence of input events that represent keyboard or mouse activity, or system events sent to Emacs. The events for keyboard activity are characters or symbols; other events are always lists. This section describes the representation and meaning of input events in detail.

function eventp object

This function returns non-nil if object is an input event or event type.

Note that any non-nil symbol might be used as an event or an event type; eventp cannot distinguish whether a symbol is intended by Lisp code to be used as an event.

Keyboard Events  Ordinary characters – keys with symbols on them.
Function Keys  Function keys – keys with names, not symbols.
Mouse Events  Overview of mouse events.
Click Events  Pushing and releasing a mouse button.
Drag Events  Moving the mouse before releasing the button.
Button-Down Events  A button was pushed and not yet released.
Repeat Events  Double and triple click (or drag, or down).
Motion Events  Just moving the mouse, not pushing a button.
Focus Events  Moving the mouse between frames.
Misc Events  Other events the system can generate.
Event Examples  Examples of the lists for mouse events.
Classifying Events  Finding the modifier keys in an event symbol. Event types.
Accessing Mouse  Functions to extract info from mouse events.
Accessing Scroll  Functions to get info from scroll bar events.
Strings of Events  Special considerations for putting keyboard character events in a string.