This module provides additional functionalities which might be helpful when you need to work a lot with DOM events.
It also can embed this plugin right into the core at the custom builds page.
Two additional constants appear in the Event class when this module is included.
Event.BUTTONS reports the mouse button numbers:
Event.KEYS contains the codes of the command keys on the keyboard:
For each of the constants a method exists which will check if that key or mouse button was pressed. The names are equivalent to the constant names above:
$('element').onClick(function(event) {
if (event.isLeftClick())
// ...
});
$('input').onKeydown(function(event) {
if (event.isEnter())
this.form.submit();
});
By default when you try to initiate events on a DOM element, RightJS will simply go through all the callbacks registered to the element by use of a fake event. This works fine, but it’s not the real thing.
If you need to fire real DOM events, you should use this module. Once included, the module wraps the original events initiation methods and uses the new ones. Therefore, nothing changes on the API level.
NOTE: Konqueror 3 does not support this feature.