ApplicationEvents

Events that have no explicit target flow to instances of the ApplicationEvents component, introduced in Enyo 0.10.

Create an instance of this object wherever you want to handle these global events. Note that global events flow to all instances of ApplicationEvents, so application code will need to handle conflicts.

Example:

components: [
  {kind: "ApplicationEvents", onWindowRotated: "windowRotated"}
...
],
...
windowRotated: function(inSender) {
  // do work when orientation changes
}

Note that you must specify your own handler methods (e.g., "windowRotated" above), as there are no handlers assigned by default.

The following table summarizes the events detected by ApplicationEvents.

Event Description
onLoad Sent after window has completed loading
onUnload Sent when window is closed
onError Sent when window cannot be loaded properly
onWindowActivated Sent when user brings window to the front
onWindowDeactivated Sent when user leaves window
onWindowParamsChange Sent when window parameters are changed via enyo.windows methods activateWindow or setWindowParams
onApplicationRelaunch Sent when the application has been relaunched by the system manager
onWindowRotated Sent when user rotates device
onOpenAppMenu Sent when user taps app menu area on device or hits app menu key (CTRL + ~) on desktop
onCloseAppMenu Sent when app menu is dismissed
onKeyup Sent for DOM keyup event
onKeydown Sent for DOM keydown event
onKeypress Sent for DOM keypress event
onBack Sent when user makes back gesture on device or hits ESC key on desktop