Previous: , Up: Events   [Contents][Index]


16.5 Synthetic Events

It is possible to create an event inside Sawfish that mimics a real keyboard or mouse event.

Function: synthesize-event event window #!optional propagate

Generate a synthetic key press or button press and send it to the X window bound to the window object. Pass the symbol root for the root window. This press is automatically followed by the appropriate release event.

The current pointer position becomes the position of the event.

Event is either an event object, or the string representation of an event (such as "A-f" or "C-M-Button3-Click2"). Strings are parsed into event objects before any work is done. See Event Name Representation.

If propagate is true, the event will propagate up the window ancestor chain until it is handled.