My aproach with that is:
var old_onmouseup = window.onmouseup;
window. (e) {
foxgameOnMouseUp(e);
if (typeof old_onmouseup == "function") old_onmouseup(e);
};
var old_onkeyup = window.onkeyup;
window. (e) {
foxgame_onKeyUpCheck(e);
if (typeof old_onkeyp == "function") old_onkeyup(e);
};
Everything on the onLoad event listener, I needed to call the previous listener allways but it is easy to change, this is working between extensions (was a fix to avoid incompatibility with autocopy) but I don't know if it works with a listener added in the web code.
On 9/25/06, Eric H. Jung <[EMAIL PROTECTED]> wrote:
Hi,
I capture keypress events in a dialog. If the keypress is a number, my listener performs an action. If it's not a number, I want the default keypress event listener to process the event. No matter what I've tried, I can't get the default event listener to process the event once my listener has the keypress.
I've tried window.addEventListener("myListener", onKeyPress, false), window.addEventListener("myListener", onKeyPress, true) where myListener is:
function myListener(evt) {
if (!isNaN( evt.charCode)) { // if user typed a number, select the corresponding tree row
var row = parseInt(evt.charCode-KeyboardEvent.DOM_VK_0)-1;
row <= accountsTree.view.rowCount-1 && accountsTree.view.selection.select (row);
// Shouldn't other event listeners now be called?
}
I've also tried the non-DOMEvent way:
var origOnKeyPress;
function onLoad() {
origOnKeyPress = window.keypress;
window.>}
function myListener(evt) {
if (!isNaN(evt.charCode)) { // if user typed a number, select the corresponding tree row
var row = parseInt(evt.charCode-KeyboardEvent.DOM_VK_0)-1;
if (row <= accountsTree.view.rowCount-1)
accountsTree.view.selection.select(row);
else
origOnKeyPress(evt);
}
else
origOnKeyPress(evt);
}
Thanks for any ideas,
Eric
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners
--
Hasta Otra
Ramiro Aparicio
---------------------------------------------------------------------------------
Webmaster de http://gs151.tk y http://www.climaxsl.es
Desarrollador de FoxGame http://foxgame.mozdev.org
_______________________________________________ Project_owners mailing list [email protected] http://mozdev.org/mailman/listinfo/project_owners
