GNU Info

Info Node: (elisp)Focus Events

(elisp)Focus Events


Next: Misc Events Prev: Motion Events Up: Input Events
Enter node , (file) or (file)node

Focus Events
------------

   Window systems provide general ways for the user to control which
window gets keyboard input.  This choice of window is called the
"focus".  When the user does something to switch between Emacs frames,
that generates a "focus event".  The normal definition of a focus event,
in the global keymap, is to select a new frame within Emacs, as the user
would expect.  Note: Input Focus.

   Focus events are represented in Lisp as lists that look like this:

     (switch-frame NEW-FRAME)

where NEW-FRAME is the frame switched to.

   Most X window managers are set up so that just moving the mouse into
a window is enough to set the focus there.  Emacs appears to do this,
because it changes the cursor to solid in the new frame.  However, there
is no need for the Lisp program to know about the focus change until
some other kind of input arrives.  So Emacs generates a focus event only
when the user actually types a keyboard key or presses a mouse button in
the new frame; just moving the mouse between frames does not generate a
focus event.

   A focus event in the middle of a key sequence would garble the
sequence.  So Emacs never generates a focus event in the middle of a key
sequence.  If the user changes focus in the middle of a key
sequence--that is, after a prefix key--then Emacs reorders the events
so that the focus event comes either before or after the multi-event key
sequence, and not within it.


automatically generated by info2www version 1.2.2.9