How to know event propagation path? - Mozilla
This is a discussion on How to know event propagation path? - Mozilla ; Hi, there,
I have a XUL dialog with default 'Cancel' button and the event
handler to response to the click of that button. Well, the 'ESC' key
will also trigger the same handler after doing something else. So I'd
like ...
-
How to know event propagation path?
Hi, there,
I have a XUL dialog with default 'Cancel' button and the event
handler to response to the click of that button. Well, the 'ESC' key
will also trigger the same handler after doing something else. So I'd
like to know what else happens when I press the 'ESC' key.
Is there any tool (like venkman or any other extension) can help to
get those information? It will also be helpful if there's any runtime
option which can enable output in console.
Thanks.
Calvin
-
Re: How to know event propagation path?
Calvin Liu wrote:
> Hi, there,
>
> I have a XUL dialog with default 'Cancel' button and the event handler
> to response to the click of that button. Well, the 'ESC' key will also
> trigger the same handler after doing something else. So I'd like to know
> what else happens when I press the 'ESC' key.
>
Both pressing the Cancel button and pressing the Esc key should result
in the same thing, except that the former occurs as a result of a
command event and the latter as the result of a key event.
-
Re: How to know event propagation path?
Hi, Neil,
Thanks for the feedback. But in my test, if I map handler to the
button event by setting dialog attribute ondialogcancel="doCancel
();", it'll be called just once when I click the button. But if I map
the key handler with the code below, then the "doCancel" function
will be called twice if I press the ESC button. So they are not
exactly the same, I assume.
Thanks.
Calvin
P.S. I tested on ff3b5pre, will test on ff2.
On 10-Mar-08, at 6:39 AM, Neil Deakin wrote:
> Calvin Liu wrote:
>> Hi, there,
>>
>> I have a XUL dialog with default 'Cancel' button and the event
>> handler
>> to response to the click of that button. Well, the 'ESC' key will
>> also
>> trigger the same handler after doing something else. So I'd like
>> to know
>> what else happens when I press the 'ESC' key.
>>
>
> Both pressing the Cancel button and pressing the Esc key should result
> in the same thing, except that the former occurs as a result of a
> command event and the latter as the result of a key event.
>
> _______________________________________________
> dev-extensions mailing list
> dev-extensions@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-extensions
>
>
-
Re: How to know event propagation path?
Calvin Liu wrote:
> Hi, Neil,
>
> Thanks for the feedback. But in my test, if I map handler to the button
> event by setting dialog attribute ondialogcancel="doCancel();", it'll be
> called just once when I click the button. But if I map the key handler
> with the code below, then the "doCancel" function will be called twice
> if I press the ESC button. So they are not exactly the same, I assume.
>
>
>
>
You shouldn't be adding your own key handler. The dialog will handle the
escape key for you.