View Full Version : Capture all events
maverickbu
10-03-2007, 06:46 AM
How do I capture all events? How would I do this for a specific object? Being able to do this would help my debugging greatly.
maverickbu
10-05-2007, 07:57 AM
Any ideas? Is it possible?
eyegony
10-08-2007, 01:52 AM
If you are trying to capture all mouse events, there's a good example in the LZX Reference > LzGlobalMouse (http://www.openlaszlo.org/lps3/docs/reference/lzglobalmouse.html).
On capturing all events of an object, there's a private array '_events' in every node that has at least one created event (http://www.openlaszlo.org/lps3/docs/reference/event.html). Maybe create a delegate and register it to all the events inside the '_events' array? will that work?
<canvas>
<button text="Button">
<handler name="oninit"> <![CDATA[
Debug.inspect( this._events );
this.del = new LzDelegate( this, "eventHandler" );
for ( var i = 0; i < this._events.length; i++ ) {
this._events[i].addDelegate( this.del );
}
]]> </handler>
<method name="eventHandler" args="data">
Debug.write( data );
</method>
</button>
</canvas>
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.