WLJS LogoWLJS Notebook

WindowEventListener

Wolfram Kernel
WindowEventListener[ev_String | ev_EventObject]
WindowEventListener["Id" -> ev_String]

acts similar to SlideEventListener and captures global events from a window, where it is placed. All events are fired on provided ev - EventObject

The following patterns can be captured:

  • "Mounted" - when the component or window has loaded
  • "Closed" - when a window is closed
  • "Blur" - when a user removes focus from a window
  • "Focus" - when a user focuses a window

This component works in regular cells as well as in WLX. It takes up no space and renders nothing.

For example

ev = EventObject[];
WindowEventListener[ev]
log = {};
Refresh[log, 1]
EventHandler[ev, {
  ev_ :> Function[Null,
    AppendTo[log, ev];
  ]
}];

Supported output forms

On this page