Event Parameter

The Event parameter is a standard JavaScript object described here:
http://www.w3schools.com/jsref/dom_obj_event.asp
Lucid did not invent the event object, but uses it extensively. Every time something happens on a page, i.e. mouse over, mouse click, keyboard click, or simply the page being loaded, an event object is created by the web browser to describe what happened. The event object will contain information such as why the event happened (i.e. click), where it happened (the DOM element) and in the case of mouse events, the x/y position of the mouse pointer.

How Lucid uses the Event object

All Lucid actions take the event object as a parameter, and pass it onto the next action, if one is attached. This means that the event object is available in all actions you create in Lucid. Lucid takes advantage of a crucial JavaScript feature which is that you may add properties to any object in JavaScript. This means that with any object, including the Event object, you may add information to it:

event.my_made_up_property = "Foo!";

The above code in JavaScript is entirely legal, even though we just made up the name of a property. A property can be any value, a bit of text like the above, a number, or a whole object as complex, or more complex than the event object itself.

We can use this ability to pass information from action to action, or onto JavaScript code outside of Lucid. You may even call custom code outside of the control of Lucid, and then return to Lucid created actions. So long as you pass the event and the senderObject, then Lucid accepts function calls from anywhere.