ui/ EventManager.jsThis library attempts to abstract events so that many controls can use, say, mouse down for example, instead of taking total control of the event The main point of this library is to delegate events to controls that care. Often times, DHTML contorls (tree controls for instance) will take hold of the document on click event, and then no other contorl or process can get that event. This library takes control of the events then allows you to register with it so that everyone can get notified in turn. To register, make a function that takes one parameter. The parameter will be the event object, and will get passed in by the manager to your function when the event gets fired. So for example the following code creates an alert box when anything on the page is clicked: click_happened = function(event){ alert(event.target) }; The event object has a few tweaks to make it act the same on all browsers, but the most common part of the event is the target property which points to the item that fired the event. Copyright2004 Rob Rohan (robr@gmai l.com) All rights reserved ohan Relatedutil/BrowserSniffer.js util/Log.js Summary
__normalizeEvent
Parameters
Returnsa uniform event object |
register an onload listner
function neuro_addLoadListener( func )
register a mouse down listener
function neuro_addMouseDownListener( func )
register a mouse up listener
function neuro_addMouseUpListener( func )
register a click listener
function neuro_addClickListener( func )
register a move listener
function neuro_addMoveListener( func )
add a keyDownListener
function neuro_addKeyDownListener( func )
add a keyUpListener
function neuro_addKeyUpListener( func )
add a key press Listener
function neuro_addKeyPressListener( func )
function __normalizeEvent( evt )
Gets the key code from an event i.e.
function neuro_getKeyCodeFromEvent( evt )
Gets the key from an event i.e.
function neuro_getKeyFromEvent( evt )